本文整理汇总了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));
}
示例2: Move
void Move(Vector3 newPos, float duration, float delay)
{
if (_moveCoroutine != null)
StopCoroutine(_moveCoroutine);
_moveCoroutine = StartCoroutine(MoveRoutine(newPos, duration, delay));
}
示例3: StartCompetitionMode
public void StartCompetitionMode(float distance)
{
if(!competitionStarting)
{
competitionRoutine = StartCoroutine(DogfightCompetitionModeRoutine(distance/2));
}
}
示例4: Start
public void Start()
{
if(StartOnStart)
{
coroutine = StartCoroutine(DestroyOnDelay());
}
}
示例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;
}
示例6: StartAutomaticRunCoroutine
private void StartAutomaticRunCoroutine()
{
if (_automaticRunCoroutine == null)
{
_automaticRunCoroutine = StartCoroutine(AutomaticRunCoroutine());
}
}
示例7: Explosion
public override void Explosion()
{
if (null != mExplosionRoutine)
return;
mExplosionRoutine = StartCoroutine(internalExplosion());
}
示例8: CancelCurrentAnim
private void CancelCurrentAnim()
{
if (animCoroutine != null) {
DialogueManager.Instance.StopCoroutine(animCoroutine);
animCoroutine = null;
}
}
示例9: LookAt
public void LookAt(Vector2 target)
{
if (lookAtCoroutine != null)
StopCoroutine(lookAtCoroutine);
lookAtCoroutine = StartCoroutine(_LookAtTarget(target));
}
示例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;
}
示例11: StartTimer
public void StartTimer(float time)
{
timerRunning = true;
timeRemaining = time;
if(_timer != null)
CoolDownManager.Instance.StopCoroutine(_timer);
_timer = CoolDownManager.Instance.StartCoroutine(CoolDownTimer(time));
}
示例12: StopAutomaticRunCoroutine
private void StopAutomaticRunCoroutine()
{
if (_automaticRunCoroutine != null)
{
StopCoroutine(_automaticRunCoroutine);
_automaticRunCoroutine = null;
}
}
示例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;
}
示例14: BeginCounter
public void BeginCounter()
{
if( m_CounterRoutine != null )
return;
Debug.Log( "Begin" );
m_CounterRoutine = StartCoroutine( NotifyRoutine() );
}
示例15: OnStopCoroutine
private void OnStopCoroutine()
{
if (coroutine != null)
{
GameLogic.Instance.StopCoroutine(coroutine);
}
coroutine = null;
}