facebook twitter hatena line email

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

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
行20: 行20:
 
==往復==
 
==往復==
 
   iTween.MoveTo (gameObject, iTween.Hash ("x", 2, "time", 3, "loopType", "pingpong"));
 
   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"));

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

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