void Awake() { RCC_Camera.OnBCGCameraSpawned += RCC_Camera_OnBCGCameraSpawned; RCC_CarControllerV3.OnRCCPlayerSpawned += RCC_CarControllerV3_OnRCCSpawned; RCC_AICarController.OnRCCAISpawned += RCC_AICarController_OnRCCAISpawned; RCC_CarControllerV3.OnRCCPlayerDestroyed += RCC_CarControllerV3_OnRCCPlayerDestroyed; RCC_AICarController.OnRCCAIDestroyed += RCC_AICarController_OnRCCAIDestroyed; activePlayerCanvas = GameObject.FindObjectOfType <RCC_UIDashboardDisplay> (); #if BCG_ENTEREXIT BCG_EnterExitPlayer.OnBCGPlayerSpawned += BCG_EnterExitPlayer_OnBCGPlayerSpawned; BCG_EnterExitPlayer.OnBCGPlayerDestroyed += BCG_EnterExitPlayer_OnBCGPlayerDestroyed; #endif // Getting default time scale of the game. orgTimeScale = Time.timeScale; recorder = gameObject.GetComponent <RCC_Recorder> (); if (!recorder) { recorder = gameObject.AddComponent <RCC_Recorder> (); } if (RCC_Settings.Instance.lockAndUnlockCursor) { Cursor.lockState = CursorLockMode.Locked; } #if ENABLE_VR UnityEngine.XR.XRSettings.enabled = RCC_Settings.Instance.useVR; #endif }
/// <summary> /// Set Customization Mode. This will enable / disable controlling the vehicle, and enable / disable orbit camera mode. /// </summary> public static void SetCustomizationMode(RCC_CarControllerV3 vehicle, bool state) { if (!vehicle) { Debug.LogError("Player vehicle is not selected for customization! Use RCC_Customization.SetCustomizationMode(playerVehicle, true/false); for enabling / disabling customization mode for player vehicle."); return; } RCC_Camera cam = RCC_SceneManager.Instance.activePlayerCamera; RCC_UIDashboardDisplay UI = RCC_SceneManager.Instance.activePlayerCanvas; if (state) { vehicle.SetCanControl(false); if (cam) { cam.ChangeCamera(RCC_Camera.CameraMode.TPS); } if (UI) { UI.SetDisplayType(RCC_UIDashboardDisplay.DisplayType.Customization); } } else { SetSmokeParticle(vehicle, false); SetExhaustFlame(vehicle, false); vehicle.SetCanControl(true); if (cam) { cam.ChangeCamera(RCC_Camera.CameraMode.TPS); } if (UI) { UI.SetDisplayType(RCC_UIDashboardDisplay.DisplayType.Full); } } }
void Awake() { if (RCC_Settings.Instance.overrideFPS) { Application.targetFrameRate = RCC_Settings.Instance.maxFPS; } if (RCC_Settings.Instance.useTelemetry) { GameObject.Instantiate(RCC_Settings.Instance.RCCTelemetry, Vector3.zero, Quaternion.identity); } RCC_Camera.OnBCGCameraSpawned += RCC_Camera_OnBCGCameraSpawned; RCC_CarControllerV3.OnRCCPlayerSpawned += RCC_CarControllerV3_OnRCCSpawned; RCC_AICarController.OnRCCAISpawned += RCC_AICarController_OnRCCAISpawned; RCC_CarControllerV3.OnRCCPlayerDestroyed += RCC_CarControllerV3_OnRCCPlayerDestroyed; RCC_AICarController.OnRCCAIDestroyed += RCC_AICarController_OnRCCAIDestroyed; activePlayerCanvas = GameObject.FindObjectOfType <RCC_UIDashboardDisplay> (); #if BCG_ENTEREXIT BCG_EnterExitPlayer.OnBCGPlayerSpawned += BCG_EnterExitPlayer_OnBCGPlayerSpawned; BCG_EnterExitPlayer.OnBCGPlayerDestroyed += BCG_EnterExitPlayer_OnBCGPlayerDestroyed; #endif // Getting default time scale of the game. orgTimeScale = Time.timeScale; if (RCC_Settings.Instance.lockAndUnlockCursor) { Cursor.lockState = CursorLockMode.Locked; } #if ENABLE_VR UnityEngine.XR.XRSettings.enabled = RCC_Settings.Instance.useVR; #endif }
void Awake() { RCC_Camera.OnBCGCameraSpawned += RCC_Camera_OnBCGCameraSpawned; RCC_CarControllerV3.OnRCCPlayerSpawned += RCC_CarControllerV3_OnRCCSpawned; RCC_AICarController.OnRCCAISpawned += RCC_AICarController_OnRCCAISpawned; RCC_CarControllerV3.OnRCCPlayerDestroyed += RCC_CarControllerV3_OnRCCPlayerDestroyed; RCC_AICarController.OnRCCAIDestroyed += RCC_AICarController_OnRCCAIDestroyed; activePlayerCanvas = GameObject.FindObjectOfType <RCC_UIDashboardDisplay> (); #if BCG_ENTEREXIT BCG_EnterExitPlayer.OnBCGPlayerSpawned += BCG_EnterExitPlayer_OnBCGPlayerSpawned; BCG_EnterExitPlayer.OnBCGPlayerDestroyed += BCG_EnterExitPlayer_OnBCGPlayerDestroyed; #endif // Getting default time scale of the game. orgTimeScale = Time.timeScale; recorder = gameObject.GetComponent <RCC_Recorder> (); if (!recorder) { recorder = gameObject.AddComponent <RCC_Recorder> (); } }