Last active
August 29, 2015 14:17
-
-
Save st0326s/7be307791e210ba66220 to your computer and use it in GitHub Desktop.
■iTween Visual EditorによるiTweenEvent・iTweenPathの使い方(メモ) ref: http://qiita.com/satotin/items/dae194179ecadd33473b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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