first time, Update the code in iTween.cs file

void CallBack(string callbackType){
if (tweenArguments.Contains(callbackType) && !tweenArguments.Contains("ischild")) {
//establish target:
GameObject target;
if (tweenArguments.Contains(callbackType+"target")) {
target=(GameObject)tweenArguments[callbackType+"target"];
}else{
target=gameObject; 
}

/// Start of update
if (tweenArguments[callbackType] is Action<object>)
{
((Action<object>)tweenArguments[callbackType]).Invoke((object)tweenArguments[callbackType + "params"]);
}
else
/// End of update


//throw an error if a string wasn't passed for callback:
if (tweenArguments[callbackType].GetType() == typeof(System.String)) {
target.SendMessage((string)tweenArguments[callbackType],(object)tweenArguments[callbackType+"params"],SendMessageOptions.DontRequireReceiver);
}else{
Debug.LogError("iTween Error: Callback method references must be passed as a String!");
Destroy (this);
}
}
}

Now, You could use the Action<T> delegate in iTween.


iTween.ValueTo(gameObject,
iTween.Hash(
"from", 1f,
"to", 0f,
"time", 1f,
"onupdate", (System.Action<object>)(x => { missedInfo.color = new Color(1f, 0f, 0f, (float)x); }),
"oncomplete", (System.Action<object>)(x => missedInfo.gameObject.SetActive(true))
)
);

 

 

2017/10/06 07:32 2017/10/06 07:32

트랙백 주소 :: 이 글에는 트랙백을 보낼 수 없습니다