private void SetThirdPersonShooterVars(PlayerController target) { view_mode = ViewMode.Third_Person_Shooter; handleCameraMove = ThirdPersonShooterCameraMove; handlePlayerRotate = delegate { }; target_follow_angle = new Vector3(0, 0, 0); target_follow_distance = new Vector3(target.cc.radius * 2f, target.GetHeadHeight(), -target.cc.height); if (current_player != null) { current_player.player_camera = null; } target.player_camera = this; current_player = target; current_player.UnregisterJumpCallback(ThirdPersonJumpCallback); // Attach the camera to the yaw_pivot and set the default distance/angles yaw_pivot.transform.parent = player_container.transform; transform.parent = pitch_pivot.transform; transform.localRotation = Quaternion.Euler(target_follow_angle); }
private void SetShooterVars(PlayerController target) { handleCameraMove = FirstPersonCameraMove; handlePlayerRotate = FirstPersonPlayerRotate; target_follow_angle = Vector3.zero; target_follow_distance = new Vector3(0, (target.cc.height / 2) - target.cc.radius, 0); if (current_player != null) { current_player.player_camera = null; } yaw_pivot.transform.parent = target.transform; yaw_pivot.transform.localPosition = Vector3.zero; target.player_camera = this; current_player = target; // Attach the camera to the yaw_pivot and set the default distance/angles transform.parent = yaw_pivot.transform; transform.localPosition = target_follow_distance; transform.localRotation = Quaternion.Euler(target_follow_angle); }
private void SetShooterVars(PlayerController target) { view_mode = ViewMode.Shooter; handleCameraMove = FirstPersonCameraMove; handlePlayerRotate = FirstPersonPlayerRotate; target_follow_angle = Vector3.zero; target_follow_distance = new Vector3(0, target.GetHeadHeight(), 0); if (current_player != null) { current_player.player_camera = null; } yaw_pivot.transform.parent = target.transform; yaw_pivot.transform.localPosition = Vector3.zero; target.player_camera = this; current_player = target; current_player.UnregisterJumpCallback(ThirdPersonJumpCallback); // Attach the camera to the yaw_pivot and set the default distance/angles yaw_pivot.transform.localRotation = Quaternion.identity; transform.parent = yaw_pivot.transform; transform.localRotation = Quaternion.Euler(target_follow_angle); }
private void SetThirdPersonActionVars(PlayerController target) { handleCameraMove = ThirdPersonCameraMove; handlePlayerRotate = ThirdPersonPlayerRotate; target_follow_angle = new Vector3(14f, 0, 0); target_follow_distance = new Vector3(0, (target.cc.height / 2), -target.cc.height * 1.5f); if (current_player != null) { current_player.player_camera = null; } target.player_camera = this; current_player = target; current_player.RegisterJumpCallback(ThirdPersonJumpCallback); // Attach the camera to the yaw_pivot and set the default distance/angles transform.parent = pitch_pivot.transform; transform.localPosition = target_follow_distance; transform.localRotation = Quaternion.Euler(target_follow_angle); // Set timers WallHitGracePeriod = 0.0f; WallHitTimeDelta = WallHitGracePeriod; }