public void Update(Controllers.BaseControllers controllers, GameObject ownerEnt, double dt) { using (UpgradeableReadLock.CreateLock(m_componentsAddQueueLock)) { foreach (var comp in m_componentsAddQueue) { AddComponent(comp); } using (WriteLock.CreateLock(m_componentsAddQueueLock)) { m_componentsAddQueue.Clear(); } } using (WriteLock.CreateLock(m_componentsRemoveQueueLock)) { foreach (var comp in m_componentsRemoveQueue) { m_componentsSorted.Remove(comp); } m_componentsRemoveQueue.Clear(); } using (ReadLock.CreateLock(m_componentsSortedLock)) { foreach (var component in m_componentsSorted) { component.Value.Tick(controllers, ownerEnt, dt); } } }
public override void Tick(Controllers.BaseControllers controllers, GameObject owner, double dt) { base.Tick(controllers, owner, dt); if (m_states.Count > 0) { var currentStateId = m_states.Count - 1; var currentState = m_states.Last(); var currentStateState = currentState.Update(controllers, owner, dt); switch (currentStateState) { case AiStateState.ASS_Completed: case AiStateState.ASS_Failed: case AiStateState.ASS_Cancelled: m_states.Remove(currentState); if (m_states.Count > currentStateId - 1) { m_states[currentStateId - 1].OnChildStateFinished(controllers, owner, currentStateState); } break; } } }
public abstract void OnReplicate(Controllers.BaseControllers controllers, GameObject ownerEnt, ReplicationData replicationData);
public virtual void Tick(Controllers.BaseControllers controllers, GameObject owner, double dt) { }
public abstract ReplicationData GetReplicationData(Controllers.BaseControllers controllers, GameObject ownerEnt);