当前位置: 首页>>代码示例>>C#>>正文


C# LTDescr.onComplete方法代码示例

本文整理汇总了C#中LTDescr.onComplete方法的典型用法代码示例。如果您正苦于以下问题:C# LTDescr.onComplete方法的具体用法?C# LTDescr.onComplete怎么用?C# LTDescr.onComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LTDescr的用法示例。


在下文中一共展示了LTDescr.onComplete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: update


//.........这里部分代码省略.........
                                }
                            }else{
                                if(onUpdate.GetType() == typeof(string)){
                                    string onUpdateS = onUpdate as string;
                                    if (tween.optional["onUpdateTarget"]!=null){
                                        customTarget = tween.optional["onUpdateTarget"] as GameObject;
                                        customTarget.BroadcastMessage( onUpdateS, val );
                                    }else{
                                        trans.gameObject.BroadcastMessage( onUpdateS, val );
                                    }
                                }else if(onUpdate.GetType() == typeof(System.Action<float, Hashtable>)){
                                    System.Action<float, Hashtable> onUpdateA = (System.Action<float, Hashtable>)onUpdate;
                                    onUpdateA(val, updateParam);
                                }else if(onUpdate.GetType() == typeof(System.Action<Vector3>)){
                                    System.Action<Vector3> onUpdateA = (System.Action<Vector3>)onUpdate;
                                    onUpdateA( newVect );
                                }else{
                                    System.Action<float> onUpdateA = (System.Action<float>)onUpdate;
                                    onUpdateA(val);
                                }
                            }
                        }
                    }
                    #endif
                }

                if(isTweenFinished){
                    // Debug.Log("finished tween:"+i+" tween:"+tween);
                    if(tweenAction==TweenAction.GUI_ROTATE)
                        tween.ltRect.rotateFinished = true;

                    if(tween.loopType==LeanTweenType.once || tween.loopCount==1){
                        if(tweenAction==TweenAction.DELAYED_SOUND){
                            AudioSource.PlayClipAtPoint((AudioClip)tween.onCompleteParam, tween.to, tween.from.x);
                        }
                        if(tween.onComplete!=null){
                            removeTween(i);
                            tween.onComplete();

                        }else if(tween.onCompleteObject!=null){
                            removeTween(i);
                            tween.onCompleteObject(tween.onCompleteParam);
                        }

                        #if !UNITY_METRO
                        else if(tween.optional!=null){
                            System.Action callback=null;
                            System.Action<object> callbackWithParam = null;
                            string callbackS=string.Empty;
                            object callbackParam=null;
                            if(tween.optional!=null && tween.trans){
                                if(tween.optional["onComplete"]!=null){
                                    callbackParam = tween.optional["onCompleteParam"];
                                    if(tween.optional["onComplete"].GetType()==typeof(string)){
                                        callbackS = tween.optional["onComplete"] as string;
                                    }else{
                                        if(callbackParam!=null){
                                            callbackWithParam = (System.Action<object>)tween.optional["onComplete"];
                                        }else{
                                            callback = (System.Action)tween.optional["onComplete"];
                                            if(callback==null)
                                                Debug.LogWarning("callback was not converted");
                                        }
                                    }
                                }
                            }
开发者ID:KittyMac,项目名称:LeanTween,代码行数:67,代码来源:LeanTween.cs

示例2: update


//.........这里部分代码省略.........
										customTarget.BroadcastMessage( onUpdateS, val );
									}else{
										trans.gameObject.BroadcastMessage( onUpdateS, val );
									}
								}else if(onUpdate.GetType() == typeof(System.Action<float, Hashtable>)){
									System.Action<float, Hashtable> onUpdateA = (System.Action<float, Hashtable>)onUpdate;
									onUpdateA(val, updateParam);
								}else if(onUpdate.GetType() == typeof(System.Action<Vector3>)){
									System.Action<Vector3> onUpdateA = (System.Action<Vector3>)onUpdate;
									onUpdateA( newVect );
								}else{
									System.Action<float> onUpdateA = (System.Action<float>)onUpdate;
									onUpdateA(val);
								}
							}
						}
					}
#endif
					}

					if (isTweenFinished)
					{
						if (tween.loopType == LeanTweenType.once || tween.loopCount == 1)
						{
							tweensFinished[finishedCnt] = i;
							finishedCnt++;

							//Debug.Log("finished tween:"+i+" tween:"+tween);
							if (tweenAction == TweenAction.GUI_ROTATE)
								tween.ltRect.rotateFinished = true;

							if (tweenAction == TweenAction.DELAYED_SOUND)
							{
								AudioSource.PlayClipAtPoint((AudioClip)tween.onCompleteParam, tween.to, tween.from.x);
							}
						}
						else
						{
							if ((tween.loopCount < 0 && tween.type == TweenAction.CALLBACK) || tween.onCompleteOnRepeat)
							{
								if (tweenAction == TweenAction.DELAYED_SOUND)
								{
									AudioSource.PlayClipAtPoint((AudioClip)tween.onCompleteParam, tween.to, tween.from.x);
								}
								if (tween.onComplete != null)
								{
									tween.onComplete();
								}
								else if (tween.onCompleteObject != null)
								{
									tween.onCompleteObject(tween.onCompleteParam);
								}
							}
							if (tween.loopCount >= 1)
							{
								tween.loopCount--;
							}
							// Debug.Log("tween.loopType:"+tween.loopType+" tween.loopCount:"+tween.loopCount+" passed:"+tween.passed);
							if (tween.loopType == LeanTweenType.pingPong)
							{
								tween.direction = 0.0f - (tween.direction);
							}
							else
							{
								tween.passed = Mathf.Epsilon;
							}
开发者ID:djfdat,项目名称:UnityTemplateProject-FolderStructure,代码行数:67,代码来源:LeanTween.cs


注:本文中的LTDescr.onComplete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。