facebook twitter hatena line email

「Unity/Csharp/iTween」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
行13: 行13:
  
 
==数秒後に数秒間移動する==
 
==数秒後に数秒間移動する==
   iTween.MoveTo (gameObject, iTween.Hash ("x", 3, "delay", 2, "time", 3));
+
   iTween.MoveTo (gameObject, iTween.Hash ("x", 2, "delay", 2, "time", 3));
  
 
==ループ==
 
==ループ==
   iTween.MoveTo (gameObject, iTween.Hash ("x", 3, "delay", 2, "time", 3, "loopType", "loop"));
+
   iTween.MoveTo (gameObject, iTween.Hash ("x", 2, "time", 3, "loopType", "loop"));
  
 
==往復==
 
==往復==
   iTween.MoveTo (gameObject, iTween.Hash ("x", 3, "delay", 2, "time", 3, "loopType", "pingpong"));
+
   iTween.MoveTo (gameObject, iTween.Hash ("x", 2, "time", 3, "loopType", "pingpong"));

2017年9月26日 (火) 02:23時点における版

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"));