Skip to content

Instantly share code, notes, and snippets.

@st0326s
Last active August 29, 2015 14:17
Show Gist options
  • Save st0326s/7be307791e210ba66220 to your computer and use it in GitHub Desktop.
Save st0326s/7be307791e210ba66220 to your computer and use it in GitHub Desktop.
■iTween Visual EditorによるiTweenEvent・iTweenPathの使い方(メモ) ref: http://qiita.com/satotin/items/dae194179ecadd33473b
_tweenEvent = gameObject.GetComponent<iTweenEvent>();
// EventTypeからEventParamMappingsのキーマップ配列を取得、これには各パラメータ型情報が入っている
var mappings = EventParamMappings.mappings[_tweenEvent.type];
System.Type valueType = mappings["speed"];
object setValue = 10;
object speed = Convert.ChangeType(setValue, valueType);
if (_tweenEvent.Values.ContainsKey("speed")){
// エディター上でチェック済みのパラメーター
_tweenEvent.Values.Remove("speed");
}
// エディター上でチェック済みのパラメーターではない
_tweenEvent.Values.Add("speed", speed);
_tweenEvent.enabled = true;
 ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment