Unity/Csharp/iTween
提供: 初心者エンジニアの簡易メモ
iTweenとは
オブジェクトを簡単い移動させるライブラリ
インストール
https://assetstore.unity.com/packages/tools/animation/itween-84
AssetStoreからDownload
数秒間で座標移動する
例:mcオブジェクト
GameObject gameObject = transform.Find ("mc").gameObject; iTween.MoveTo(gameObject, new Vector3(2f, 2f, 0), 2.0f);
数秒後に数秒間移動する
iTween.MoveTo (gameObject, iTween.Hash ("x", 2, "delay", 2, "time", 3));
ループ
iTween.MoveTo (gameObject, iTween.Hash ("x", 2, "time", 3, "loopType", "loop"));
往復
iTween.MoveTo (gameObject, iTween.Hash ("x", 2, "time", 3, "loopType", "pingpong"));
点滅っぽいループ
iTween.ColorTo(gameObject, iTween.Hash("r" ,0.7f, "g" ,0.7f, "b" ,0.7f, "time", 0.5f, "loopType", "pingpong"));
点滅っぽいループ(透明版)
iTween.ColorTo(gameObject, iTween.Hash("a", 0.5f, "time", 1.0, "loopType", "pingpong"));