Last active
December 23, 2015 07:49
-
-
Save daponta/6602964 to your computer and use it in GitHub Desktop.
iTweenサンプル
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
/* | |
* ローカル座標系で指定座標へ移動・回転 | |
* 第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