using System;
using System.Collections.Generic;
using UnityEngine;
namespace coa4u
{
///
/// Instantly tints the target to the given color.
///
class ActionSetTint : ActionInstant
{
public Vector4 color;
protected const float coeff = 1F / 255F;
public ActionSetTint(Vector4 tgtColor)
: base()
{
color = tgtColor * coeff;
}
///
/// Returns a copy of the action.
///
public override ActionInstant clone()
{
return new ActionSetTint(color * 255F);
}
///
/// This method is called at the action start.
///
public override void start()
{
base.start();
renderer.material.color = new Color(color[0], color[1], color[2], color[3]);
}
}
}