//Player Listener private void PlayerAction(Player.PlayerAction playerAction) { switch (playerAction) { case Player.PlayerAction.reflect: if (player.rBody.velocity.x != 0) { CamRotation.ReflectRotationSwitch(player, reflectRotationSwitchDuration); } break; case Player.PlayerAction.charge: CamZoom.ZoomToVelocity(player, defaultTransitionDuration); CamRotation.RotateToVelocity(player, defaultTransitionDuration); break; case Player.PlayerAction.decharge: CamRotation.RotateToVelocity(player, defaultTransitionDuration); break; case Player.PlayerAction.teleport: CamMove.StopFollowing(); CamMove.MoveCamTo(Player.destinationPortal.transform.position, player.teleportDuration); break; default: break; } }
//Player Listener private void PlayerStateChanged(Player.PlayerState playerState) { switch (playerState) { case Player.PlayerState.alive: CamMove.StartFollowing(); CamZoom.ZoomToVelocity(player, defaultTransitionDuration); //CamShake.VelocityShake(player); CamRotation.VelocityRotation(player); // currently deactivated in CamRotation break; case Player.PlayerState.dead: CamZoom.DeathZoom(Game.deathDelay); CamShake.DeathShake(); CamRotation.RotateToDefault(Game.deathDelay); //CamRotation.DeathRotation(); //change to camshake //CamMove.StopFollowing(); break; case Player.PlayerState.win: CamZoom.WinZoom(Game.deathDelay); CamRotation.RotateToDefault(Game.deathDelay); //CamRotation.DeathRotation(); //change to camshake //CamMove.StopFollowing(); break; default: break; } }
private void Awake() { _instance = this; }