Skip to content

Instantly share code, notes, and snippets.

@nopitech
Created October 19, 2017 17:23
Show Gist options
  • Save nopitech/7b07a5eef0f119035612ed8fef31cd8a to your computer and use it in GitHub Desktop.
Save nopitech/7b07a5eef0f119035612ed8fef31cd8a to your computer and use it in GitHub Desktop.
iTween.ValueTo
public class iTweenMethod : MonoBehaviour
{
// UI Image
public Image image;
// 最初の色と最後の色を選択
public Color startColor;
public Color endColor;
void Start()
{
ValueTo();
}
void ValueTo()
{
iTween.ValueTo(gameObject,
iTween.Hash(
"from", startColor,
"to", endColor,
"delay", 1f,
"time", 2f,
"onupdatetarget", gameObject,
"onupdate", "OnUpdateColor"
)
);
}
void OnUpdateColor(Color color)
{
image.color = color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment