// Lerp from room to room. When finished, snap to the final position and // re-enable the collision. // private void TransitionUpdate() { float fRatio = (TimerManager.fGameTime - m_fTransitionEventTime) / Types.s_fCAM_RoomTransitionDuration; m_gcRgdBdy.MovePosition(Vector3.Lerp(GameGlobals.s_vRoomTransitionFrom, GameGlobals.s_vRoomTransitionTo, Easing.EaseInOut(fRatio, EEasingType.Quintic))); if (fRatio >= 1.0f) { m_iControllerState = EPlayerControllerState._PLAYER_ACTIVE; m_fTransitionEventTime = 0.0f; transform.position = GameGlobals.s_vRoomTransitionTo; m_gcCollision.enabled = true; } }
public void EndTeleport() { m_iControllerState = EPlayerControllerState._PLAYER_ACTIVE; m_gcCollision.enabled = true; }
public void BeginTeleport() { m_iControllerState = EPlayerControllerState._TRANSITIONING_ROOMS; m_gcCollision.enabled = false; }
// Setup the params for the lerp between rooms. // Collision must be disabled, as it's possible to be scraping a polygon // collider when the doorway trigger is touched. It'll possibly look a // little odd, but better to teleport through something solid than be // stuck off-screen! // public void BeginRoomTransition() { m_fTransitionEventTime = TimerManager.fGameTime; m_iControllerState = EPlayerControllerState._TRANSITIONING_ROOMS; m_gcCollision.enabled = false; }