Created
October 19, 2017 17:23
-
-
Save nopitech/7b07a5eef0f119035612ed8fef31cd8a to your computer and use it in GitHub Desktop.
iTween.ValueTo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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