/// <summary> /// MUST BE CALLED FROM WITHIN m_movementLock! /// </summary> /// <param name="movement"></param> private void BeginTrackingFrames(MovementDescription movement) { if (m_currentMovement != null) { return; } m_currentMovement = movement; if (movement is AvatarFollower.AvatarFollowerDescription) { m_movementAction = new AvatarFollower(movement, this); } else if (movement is WanderingAction.WanderingDescription) { m_movementAction = new WanderingAction(movement, this); } else { m_movementAction = new NavigationPathAction(movement, this); } m_movementAction.Start(); m_movementAction.SetBeginningOfMovementFrame(); m_scene.EventManager.OnFrame += Scene_OnFrame; }
/// <summary> /// MUST BE CALLED FROM WITHIN m_movementLock! /// </summary> /// <param name="movement"></param> private void StopTrackingFrames() { if (m_currentMovement == null) { return; } m_movementAction.Stop(); m_movementAction = null; m_currentMovement = null; m_scene.EventManager.OnFrame -= Scene_OnFrame; }
/// <summary> /// MUST BE CALLED FROM WITHIN m_movementLock! /// </summary> /// <param name="movement"></param> private void StopTrackingFrames() { if (m_currentMovement == null) return; m_movementAction.Stop(); m_movementAction = null; m_currentMovement = null; m_scene.EventManager.OnFrame -= Scene_OnFrame; }
/// <summary> /// MUST BE CALLED FROM WITHIN m_movementLock! /// </summary> /// <param name="movement"></param> private void BeginTrackingFrames(MovementDescription movement) { if (m_currentMovement != null) return; m_currentMovement = movement; if (movement is AvatarFollower.AvatarFollowerDescription) m_movementAction = new AvatarFollower(movement, this); else if (movement is WanderingAction.WanderingDescription) m_movementAction = new WanderingAction(movement, this); else m_movementAction = new NavigationPathAction(movement, this); m_movementAction.Start(); m_movementAction.SetBeginningOfMovementFrame(); m_scene.EventManager.OnFrame += Scene_OnFrame; }