예제 #1
0
        private static void AddClouds()
        {
            Camera mainCamera = GaiaUtils.GetCamera();

            if (mainCamera != null)
            {
                MassiveClouds clouds = mainCamera.GetComponent <MassiveClouds>();
                if (clouds == null)
                {
                    clouds = mainCamera.gameObject.AddComponent <MassiveClouds>();
                }

                List <MassiveCloudsProfile>   profiles   = new List <MassiveCloudsProfile>();
                MassiveCloudsProfile          profile    = AssetDatabase.LoadAssetAtPath <MassiveCloudsProfile>(GaiaUtils.GetAssetPath("Cloudy C.asset"));
                List <MassiveCloudsParameter> parameters = new List <MassiveCloudsParameter>();
                if (profile != null)
                {
                    profiles.Add(profile);
                    parameters.Add(profile.Parameter);
                    clouds.SetProfiles(profiles);
                    clouds.SetParameters(parameters);
                }

                MassiveCloudsCameraEffect cloudsEffect = mainCamera.GetComponent <MassiveCloudsCameraEffect>();
                if (cloudsEffect == null)
                {
                    cloudsEffect = mainCamera.gameObject.AddComponent <MassiveCloudsCameraEffect>();
                }
            }
        }
예제 #2
0
        private static void RemoveClouds()
        {
            Camera mainCamera = GaiaUtils.GetCamera();

            if (mainCamera != null)
            {
                MassiveCloudsCameraEffect cloudsEffect = mainCamera.GetComponent <MassiveCloudsCameraEffect>();
                if (cloudsEffect != null)
                {
                    GameObject.DestroyImmediate(cloudsEffect);
                }

                MassiveClouds clouds = mainCamera.GetComponent <MassiveClouds>();
                if (clouds != null)
                {
                    GameObject.DestroyImmediate(clouds);
                }
            }
        }