Example #1
0
        private void OnEnable()
        {
            //Get Gaia Lighting Profile object
            m_profile = (ScreenShotter)target;

            if (m_editorUtils == null)
            {
                // Get editor utils for this
                m_editorUtils = PWApp.GetEditorUtils(this);
            }
        }
Example #2
0
        public static void FinalizeCameraObjectRuntime(Camera cameraObject)
        {
            if (cameraObject == null)
            {
                return;
            }

            CharacterController controller = GameObject.FindObjectOfType <CharacterController>();
            GameObject          xr         = GameObject.Find(GaiaConstants.playerXRName);

#if GAIA_PRO_PRESENT
            if (PW_VFX_Clouds.Instance != null)
            {
                PW_VFX_Clouds.Instance.GameCam = cameraObject;
            }

            if (ProceduralWorldsGlobalWeather.Instance != null)
            {
                ProceduralWorldsGlobalWeather.Instance.m_player = cameraObject.transform;
            }

            if (GaiaAudioManager.Instance != null)
            {
                if (controller == null)
                {
                    if (xr != null)
                    {
                        GaiaAudioManager.Instance.m_player = xr;
                    }
                }
                else
                {
                    GaiaAudioManager.Instance.m_player = controller.gameObject;
                }
            }
#endif
            if (PWS_WaterSystem.Instance != null)
            {
                PWS_WaterSystem.Instance.m_RenderCamera = cameraObject;
                PWS_WaterSystem.Instance.m_gameCamera   = cameraObject;
                if (controller == null)
                {
                    if (xr != null)
                    {
                        PWS_WaterSystem.Instance.m_player = xr.transform;
                    }
                }
                else
                {
                    PWS_WaterSystem.Instance.m_player = controller.transform;
                }
            }

            if (GaiaUnderwaterEffects.Instance != null)
            {
                GaiaUnderwaterEffects.Instance.m_playerCamera = cameraObject.transform;
            }

            if (Instance != null)
            {
                Instance.m_mainCamera = cameraObject;
            }

            ScreenShotter screenShotter = GameObject.FindObjectOfType <ScreenShotter>();
            if (screenShotter != null)
            {
                screenShotter.m_mainCamera = cameraObject;
            }

            FollowPlayerSystem[] followPlayerSystems = GameObject.FindObjectsOfType <FollowPlayerSystem>();
            foreach (var system in followPlayerSystems)
            {
                system.m_player = cameraObject.transform;
            }
        }