iTweenサンプル
/* | |
* ローカル座標系で指定座標へ移動・回転 | |
* 第1引数:ターゲットGameObject, 第2引数:移動に関する各種パラメータのハッシュ | |
* iTween.Hashでキーバリュー形式のハッシュ作成 | |
*/ | |
void Start() { | |
iTween.MoveTo(this.gameObject, iTween.Hash( | |
"position", Vector3.zero, | |
"time", 0.5, | |
"oncomplete", "complete", | |
"oncompletetarget", this.gameObject, | |
"easeType", "linear" | |
//"space", Space.worldでグローバル座標系で移動 | |
)); | |
iTween.RotateTo(this.gameObject, iTween.Hash( | |
"x", 90, | |
"time", 0.2, | |
)); | |
} | |
//終了時実行メソッド | |
//iTween.Stop(gameobject, アニメーションタイプ(オプション); | |
//ターゲットのTweenを終了する | |
public void complete() { | |
iTween.Stop(this.gameobject, "move"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment