public bool Validate(Fiber inFiber) { return(inFiber.HasHost(Host)); }
public bool Validate(Fiber inFiber) { return(inFiber.HasHost(Host) && inFiber.HasName(Name)); }
public bool Validate(Fiber inFiber) { return(true); }
public bool Validate(Fiber inFiber) { return(inFiber.HasHost(Host) && inFiber.HasGroups(GroupMask)); }
/// <summary> /// Adds a Fiber to the free list. /// </summary> public void AddFreeFiber(Fiber inFiber) { AddFirst(inFiber, ref m_FreeList); }
/// <summary> /// Manually updates the given routine. /// </summary> public bool ManualUpdate(Fiber inFiber, float inDeltaTime) { if (!inFiber.PrepareManualUpdate()) { return(false); } Frame oldFrame = Frame; bool bPrevUpdating = m_Updating; if (bPrevUpdating) { // Copy this, so we have a consistent group time scale // for any previous updates oldFrame.GroupTimeScale = (float[])oldFrame.GroupTimeScale.Clone(); } Frame.IncrementSerial(); Frame.ResetTime(inDeltaTime, TimeScale); Frame.PauseMask = m_QueuedPauseMask; if (m_GroupTimescaleDirty) { if (!bPrevUpdating) { m_GroupTimescaleDirty = false; } Array.Copy(m_QueuedGroupTimescale, Frame.GroupTimeScale, Routine.MAX_GROUPS); } m_Updating = true; { #if DEVELOPMENT if (m_DebugMode && !bPrevUpdating && ProfilingEnabled) { m_UpdateTimer.Reset(); m_UpdateTimer.Start(); if (m_NeedsSnapshot) { m_Snapshot = GetRoutineStats(); m_NeedsSnapshot = false; } Fibers.RunManualUpdate(inFiber); Frame.ResetTimeScale(); m_UpdateTimer.Stop(); m_TotalUpdateTime += m_UpdateTimer.ElapsedTicks; } else #endif // DEVELOPMENT { Fibers.RunManualUpdate(inFiber); Frame.ResetTimeScale(); } } m_Updating = bPrevUpdating; Frame = oldFrame; if (!m_Updating) { if (m_Destroying) { m_Destroying = false; Destroy(); } } return(true); }
/// <summary> /// Adds a Fiber to the active list. /// </summary> public void AddActiveFiber(Fiber inFiber) { AddLast(inFiber, ref m_ActiveList); }
/// <summary> /// Removes a Fiber from the active list. /// </summary> public void RemoveActiveFiber(Fiber inFiber) { RemoveEntry(inFiber, ref m_ActiveList); }
/// <summary> /// Sets the parent Fiber to use for time scaling. /// </summary> public void SetParentFiber(Fiber inFiber) { m_RootFiber = inFiber.m_RootFiber == null ? inFiber : inFiber.m_RootFiber; }
/// <summary> /// Cleans up the Fiber. /// </summary> public void Dispose() { if ((uint)m_Handle == 0) { return; } if (m_UnityWait != null) { Manager.Host.StopCoroutine(m_UnityWait); m_UnityWait = null; } bool bKilled = m_StackPosition >= 0; bool bChained = m_Chained; ClearStack(); m_Handle = Routine.Null; m_Host = null; m_HostIdentity = null; // If this is chained and we have a parallel if (bChained && m_Parallel != null) { m_Parallel.RemoveFiber(this); } m_Chained = m_Disposing = m_HasIdentity = m_Paused = m_IgnoreObjectTimescale = m_HostedByManager = m_IgnoreObjectActive = m_Executing = false; m_WaitTime = 0; m_Name = null; Priority = 0; m_Parallel = null; m_RootFiber = null; m_TimeScale = 1.0f; m_YieldFrameDelay = 0; if (m_YieldPhase != YieldPhase.None) { Manager.Fibers.RemoveFiberFromYieldList(this, m_YieldPhase); m_YieldPhase = YieldPhase.None; } if (!bChained) { Manager.Fibers.RemoveFiberFromUpdateList(this, m_UpdatePhase); } Manager.RecycleFiber(this, bChained); m_UpdatePhase = Manager.DefaultPhase; m_OnException = null; m_HandleExceptions = false; if (bKilled) { m_OnComplete = null; Action onStop = m_OnStop; m_OnStop = null; if (onStop != null) { onStop(); } } else { m_OnStop = null; Action onComplete = m_OnComplete; m_OnComplete = null; if (onComplete != null) { onComplete(); } } }
public void Dispose() { m_Current = 0; m_Fiber = null; }
public WaitEnumerator(Fiber inFiber) { m_Fiber = inFiber; m_Current = (uint)m_Fiber.m_Handle; }
void INestedFiberContainer.SetParentFiber(Fiber inFiber) { m_ParentFiber = inFiber; }