Skip to content

Instantly share code, notes, and snippets.

@daponta
Last active December 23, 2015 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daponta/6602964 to your computer and use it in GitHub Desktop.
Save daponta/6602964 to your computer and use it in GitHub Desktop.
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