當前位置: 首頁>>代碼示例>>C#>>正文


C# UnityEngine.Coroutine類代碼示例

本文整理匯總了C#中UnityEngine.Coroutine的典型用法代碼示例。如果您正苦於以下問題:C# Coroutine類的具體用法?C# Coroutine怎麽用?C# Coroutine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Coroutine類屬於UnityEngine命名空間,在下文中一共展示了Coroutine類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Idle

 public Idle(Customer customer, float seconds = 5)
     : base(customer)
 {
     // Think about being idle
     customer.Think(supermarket.IdleIcon);
     delay = customer.StartCoroutine(Delay(seconds));
 }
開發者ID:Clarksj4,項目名稱:Theme-Supermarket-Tycoon-World,代碼行數:7,代碼來源:Idle.cs

示例2: Move

 void Move(Vector3 newPos, float duration, float delay)
 {
     if (_moveCoroutine != null)
         StopCoroutine(_moveCoroutine);
 
     _moveCoroutine = StartCoroutine(MoveRoutine(newPos, duration, delay));
 }
開發者ID:millwardesque,項目名稱:TrainDevChallenge,代碼行數:7,代碼來源:Door.cs

示例3: StartCompetitionMode

		public void StartCompetitionMode(float distance)
		{
			if(!competitionStarting)
			{
				competitionRoutine = StartCoroutine(DogfightCompetitionModeRoutine(distance/2));
			}
		}
開發者ID:tetryds,項目名稱:BDArmory,代碼行數:7,代碼來源:BDACompetitionMode.cs

示例4: Start

 public void Start()
 {
     if(StartOnStart)
     {
         coroutine = StartCoroutine(DestroyOnDelay());
     }
 }
開發者ID:flatlineteam,項目名稱:CartoonNetworkJam-Zer0,代碼行數:7,代碼來源:DestroyAfterTime.cs

示例5: UIShowHideController

 public UIShowHideController(GameObject go, Component panel)
 {
     this.panel = panel;
     this.animator = (go != null) ? go.GetComponent<Animator>() : null;
     if (animator == null && panel != null) animator = panel.GetComponent<Animator>();
     this.animCoroutine = null;
 }
開發者ID:tomasmed,項目名稱:AmazonWarriors,代碼行數:7,代碼來源:UIShowHideController.cs

示例6: StartAutomaticRunCoroutine

 private void StartAutomaticRunCoroutine()
 {
     if (_automaticRunCoroutine == null)
     {
         _automaticRunCoroutine = StartCoroutine(AutomaticRunCoroutine());
     }
 }
開發者ID:nubick,項目名稱:tween-peaks,代碼行數:7,代碼來源:FadeTweensView.cs

示例7: Explosion

        public override void Explosion()
        {
            if (null != mExplosionRoutine)
                return;

            mExplosionRoutine = StartCoroutine(internalExplosion());
        }
開發者ID:MasakiWang,項目名稱:Team-Trainning-2015-08,代碼行數:7,代碼來源:Block.cs

示例8: CancelCurrentAnim

 private void CancelCurrentAnim()
 {
     if (animCoroutine != null) {
         DialogueManager.Instance.StopCoroutine(animCoroutine);
         animCoroutine = null;
     }
 }
開發者ID:tomasmed,項目名稱:AmazonWarriors,代碼行數:7,代碼來源:UIShowHideController.cs

示例9: LookAt

        public void LookAt(Vector2 target)
        {
            if (lookAtCoroutine != null)
                StopCoroutine(lookAtCoroutine);

            lookAtCoroutine = StartCoroutine(_LookAtTarget(target));
        }
開發者ID:LuciusSixPercent,項目名稱:Finsternis,代碼行數:7,代碼來源:MenuEyeController.cs

示例10: Create

		/// <summary>
		/// Creates a TrackedCoroutine attached to a new container object that will destroy itself when finished.
		/// </summary>
		/// <param name="routine">Coroutine to run; if arguments are needed, pass an anonymous wrapper</param>
		/// <param name="name">Name of the container object</param>
		/// <param name="parent">Parent of the container object</param>
		/// <returns>Created TrackedCoroutine instance</returns>
		public static TrackedCoroutine Create(Coroutine routine, string name = "TrackedCoroutine", GameObject parent = null)
		{
			var instance = GameObjectUtils.InstantiateNewSingle<TrackedCoroutine>(name, parent);
			instance.Routine = routine;
			instance.DestroyOnComplete = true;
			return instance;
		}
開發者ID:orbitalgames,項目名稱:unity-utilities,代碼行數:14,代碼來源:TrackedCoroutine.cs

示例11: StartTimer

 public void StartTimer(float time)
 {
     timerRunning = true;
     timeRemaining = time;
     if(_timer != null)
         CoolDownManager.Instance.StopCoroutine(_timer);
     _timer = CoolDownManager.Instance.StartCoroutine(CoolDownTimer(time));
 }
開發者ID:gamezfordayz,項目名稱:CodeNameKidsNextDoor,代碼行數:8,代碼來源:Timer.cs

示例12: StopAutomaticRunCoroutine

 private void StopAutomaticRunCoroutine()
 {
     if (_automaticRunCoroutine != null)
     {
         StopCoroutine(_automaticRunCoroutine);
         _automaticRunCoroutine = null;
     }
 }
開發者ID:nubick,項目名稱:tween-peaks,代碼行數:8,代碼來源:FadeTweensView.cs

示例13: AddCoroutine

 public int AddCoroutine(IEnumerator coroutine, ECoroutineLevel level = ECoroutineLevel.High)
 {
     Coroutine cr = new Coroutine();
     cr.coroutine = coroutine;
     cr.crLevel = (int)level;
     mCoroutineDic[mIndex++] = cr;
     return mIndex;
 }
開發者ID:yuisunn,項目名稱:UnityCrazy,代碼行數:8,代碼來源:Coroutiner.cs

示例14: BeginCounter

		public void BeginCounter()
		{
			if( m_CounterRoutine != null )
				return;

			Debug.Log( "Begin" );
			m_CounterRoutine = StartCoroutine( NotifyRoutine() );
		}
開發者ID:odbb,項目名稱:ggj16,代碼行數:8,代碼來源:BalloonsApp.cs

示例15: OnStopCoroutine

 private void OnStopCoroutine()
 {
     if (coroutine != null)
     {
         GameLogic.Instance.StopCoroutine(coroutine);
     }
     coroutine = null;
 }
開發者ID:aeonphyxius,項目名稱:unity_extensions,代碼行數:8,代碼來源:EnemyWaitAction.cs


注:本文中的UnityEngine.Coroutine類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。