Skip to content

Instantly share code, notes, and snippets.

@maco1028
Last active September 9, 2017 17:12
Show Gist options
  • Save maco1028/df3695ad7ca098ae81d3e0a813fd46e6 to your computer and use it in GitHub Desktop.
Save maco1028/df3695ad7ca098ae81d3e0a813fd46e6 to your computer and use it in GitHub Desktop.
iTween標準 #unity
【●秒かけて値を●~●まで変化させる】
//2秒かけて値を0~100まで変化させる。
iTween.ValueTo(gameObject, iTween.Hash("from", 0 "to", 100.0f, "time", 2.0f, "onupdate", "ValueChange"));
//完了したら
void ValueChange(float value){
Debug.Log(value);
}
【iTweenを連続で処理する】(delayを追加するといい)
iTween.ShakePosition(gameObject, iTween.Hash("x", 0.2f, "y", 0.2f));
iTween.ScaleTo (gameObject, iTween.Hash ("x", 2f, "y", 2f, "time", 1.0f));
iTween.ScaleTo (gameObject, iTween.Hash ("x", 1.5f, "y", 1.5f, "time", 2.0f,"delay", 1.0f ));
【●秒かけてVetor3(x,y,z)の位置まで移動する】
//2秒かけてVector3(10,0,0)まで移動する
iTween.MoveTo(gameObject, new Vector3(10,0,0),2.0f);
【●秒かけて●度回転する】
//3秒かけてyを180ど回転させる
iTween.RotateTo(gameObject, iTween.Hash("y",180, "time", 3.0f));
【●秒かけて拡大縮小を行う】
//4秒かけてスケールを2まで拡大縮小する
iTween.ScaleTo(gameObject, iTween.Hash("scale", 2, "time", 4.0f));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment