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;
}
//
if (tweenArguments[callbackType] is Action<object>)
{
((Action<object>)tweenArguments[callbackType]).Invoke((object)tweenArguments[callbackType + "params"]);
}
else
//
//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.
iTween更改onupdate代理方法
最新推荐文章于 2023-11-06 11:01:32 发布
本文介绍了如何在Unity3D中通过代理(Delegate)方式来改变iTween的onupdate事件,从而实现更灵活的更新行为。这种方法允许开发者在iTween动画过程中执行自定义代码。
摘要由CSDN通过智能技术生成