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


C# LTDescr.init方法代码示例

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


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

示例1: update

	public static void update()
	{
		if (frameRendered != Time.frameCount)
		{ // make sure update is only called once per frame
			init();

#if UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5
		dtEstimated = Time.realtimeSinceStartup - previousRealTime;
		if(dtEstimated>0.2f) // a catch put in, when at the start sometimes this number can grow unrealistically large
			dtEstimated = 0.2f;
		previousRealTime = Time.realtimeSinceStartup;
#else
			dtEstimated = Time.unscaledDeltaTime;
#endif

			dtActual = Time.deltaTime;
			maxTweenReached = 0;
			finishedCnt = 0;
			// if(tweenMaxSearch>1500)
			// Debug.Log("tweenMaxSearch:"+tweenMaxSearch +" maxTweens:"+maxTweens);
			for (int i = 0; i <= tweenMaxSearch && i < maxTweens; i++)
			{

				//if(i==0 && tweens[i].toggle)
				//	Debug.Log("tweens["+i+"]"+tweens[i]+" dt:"+dt);
				if (tweens[i].toggle)
				{
					maxTweenReached = i;
					tween = tweens[i];
					trans = tween.trans;
					timeTotal = tween.time;
					tweenAction = tween.type;

					/*if(trans.gameObject.name=="Main Camera"){
						Debug.Log("main tween:"+tween+" i:"+i);
					}*/

					if (tween.useEstimatedTime)
					{
						dt = dtEstimated;
					}
					else if (tween.useFrames)
					{
						dt = 1;
					}
					else if (tween.useManualTime)
					{
						dt = dtManual;
					}
					else if (tween.direction == 0f)
					{
						dt = 0f;
					}
					else
					{
						dt = dtActual;
					}

					if (trans == null)
					{
						removeTween(i);
						continue;
					}
					// Debug.Log("i:"+i+" tween:"+tween+" dt:"+dt);

					// Check for tween finished
					isTweenFinished = false;
					if (tween.delay <= 0)
					{
						if ((tween.passed + dt > tween.time && tween.direction > 0.0f))
						{
							// Debug.Log("i:"+i+" passed:"+tween.passed+" dt:"+dt+" time:"+tween.time+" dir:"+tween.direction);
							isTweenFinished = true;
							tween.passed = tween.time; // Set to the exact end time so that it can finish tween exactly on the end value
						}
						else if (tween.direction < 0.0f && tween.passed - dt < 0.0f)
						{
							isTweenFinished = true;
							tween.passed = Mathf.Epsilon;
						}
					}

					if (!tween.hasInitiliazed && ((tween.passed == 0.0 && tween.delay == 0.0) || tween.passed > 0.0))
					{
						tween.init();
					}

					if (tween.delay <= 0)
					{
						// Move Values
						if (timeTotal <= 0f)
						{
							//Debug.LogError("time total is zero Time.timeScale:"+Time.timeScale+" useEstimatedTime:"+tween.useEstimatedTime);
							ratioPassed = 1f;
						}
						else
						{
							ratioPassed = tween.passed / timeTotal;
						}

//.........这里部分代码省略.........
开发者ID:djfdat,项目名称:UnityTemplateProject-FolderStructure,代码行数:101,代码来源:LeanTween.cs

示例2: DoAnim

 public void DoAnim()
 {
     Debug.Log("DoAnim "+gameObject.name);
     deamHandLTDesc = LeanTween.move(DemonHand, where2Go, timeToComplete);
     //deamHandLTDesc.setDestroyOnComplete(shouldDestroyOnComplete);
     deamHandLTDesc.setOnUpdate(OnUpdate);
     deamHandLTDesc.setOnComplete(nextStep);
     deamHandLTDesc.setEase(easyType);
     deamHandLTDesc.init();
 }
开发者ID:vetruven,项目名称:GGJ2016,代码行数:10,代码来源:AnimStep.cs


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