示例#1
0
        /// <summary>
        /// Adds a new user profile
        /// </summary>
        private void AddNewCustomProfile()
        {
            //GaiaLightingProfileValues selectdValues = m_savedSettings.LoadSettings(m_profile, true);
            GaiaLightingProfileValues selectdValues = m_profileValues;
            GaiaLightingProfileValues newProfile    = new GaiaLightingProfileValues();

            GaiaUtils.CopyFields(selectdValues, newProfile);
            int count = m_profile.m_lightingProfiles.Count + 1;

            newProfile.m_typeOfLighting    = "New User Profile " + count;
            newProfile.m_userCustomProfile = true;
            m_profile.m_lightingProfiles.Add(newProfile);
            m_profile.m_selectedLightingProfileValuesIndex = m_profile.m_lightingProfiles.Count - 1;

            if (m_profile.m_selectedLightingProfileValuesIndex != -99)
            {
                GaiaUtils.GetRuntimeSceneObject();

                if (GaiaGlobal.Instance != null)
                {
                    GaiaLighting.GetProfile(m_profile, m_gaiaSettings.m_pipelineProfile, m_gaiaSettings.m_pipelineProfile.m_activePipelineInstalled);
                }
            }

            EditorUtility.SetDirty(m_profile);
        }
示例#2
0
        public static void ConvertProfileToHDRP(SceneProfile lightingProfile, GaiaLightingProfileValues profile, bool convertToNewProfile = false)
        {
            try
            {
                if (GaiaUtils.GetActivePipeline() != GaiaConstants.EnvironmentRenderer.HighDefinition)
                {
                    Debug.Log("Need to be using High Definition render pipeline to use this function");
                    return;
                }

                GaiaLightingProfileValues profileValue = profile;
                if (convertToNewProfile)
                {
                    GaiaLightingProfileValues newProfileValues = new GaiaLightingProfileValues();
                    GaiaUtils.CopyFields(profile, newProfileValues);
                    profileValue = newProfileValues;
                    lightingProfile.m_lightingProfiles.Add(profileValue);
                    profileValue.m_typeOfLighting = "Converted HDRP Profile " + (lightingProfile.m_lightingProfiles.Count - 1);
                    lightingProfile.m_selectedLightingProfileValuesIndex = lightingProfile.m_lightingProfiles.Count - 1;
                }

                if (EditorUtility.DisplayDialog("Convert Sun", "Would you like to convert the Sun Values", "Yes", "No"))
                {
                    ConvertSun(profileValue, GaiaConstants.EnvironmentRenderer.HighDefinition);
                }

                //ConvertPWWeather(profileValue, GaiaConstants.EnvironmentRenderer.HighDefinition);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
示例#3
0
 public void OverrideBookmark(LocationSystem locationSystem)
 {
     if (locationSystem != null)
     {
         GaiaUtils.CopyFields(GetCurrentLocation(locationSystem), m_bookmarkedSettings[locationSystem.m_selectedBookmark]);
     }
 }
示例#4
0
        private void SavePWSkyWeather(GaiaLightingProfileValues profileValues, ProceduralWorldsGlobalWeather globalWeather)
        {
            if (profileValues == null || globalWeather == null)
            {
                return;
            }

            profileValues.m_pwSkyWeatherData.m_weatherFadeDuration  = globalWeather.m_weatherFadeDuration;
            profileValues.m_pwSkyWeatherData.m_modifyFog            = globalWeather.m_modifyFog;
            profileValues.m_pwSkyWeatherData.m_modifyWind           = globalWeather.m_modifyWind;
            profileValues.m_pwSkyWeatherData.m_modifySkybox         = globalWeather.m_modifySkybox;
            profileValues.m_pwSkyWeatherData.m_modifyPostProcessing = globalWeather.m_modifyPostProcessing;
            profileValues.m_pwSkyWeatherData.m_modifySun            = globalWeather.m_modifySun;
            profileValues.m_pwSkyWeatherData.m_modifyAmbient        = globalWeather.m_modifyAmbient;
            profileValues.m_pwSkyWeatherData.m_modifyClouds         = globalWeather.m_modifyClouds;

            profileValues.m_pwSkyWeatherData.m_rainSettings.EnableRain     = globalWeather.EnableRain;
            profileValues.m_pwSkyWeatherData.m_rainSettings.RainIntensity  = globalWeather.RainIntensity;
            profileValues.m_pwSkyWeatherData.m_rainSettings.m_rainMode     = globalWeather.m_rainMode;
            profileValues.m_pwSkyWeatherData.m_rainSettings.m_rainHeight   = globalWeather.m_rainHeight;
            profileValues.m_pwSkyWeatherData.m_rainSettings.m_rainStepSize = globalWeather.m_rainStepSize;
            GaiaUtils.CopyFields(globalWeather.m_rainWeatherSettings, profileValues.m_pwSkyWeatherData.m_rainSettings.m_rainWeatherSettings);

            profileValues.m_pwSkyWeatherData.m_snowSettings.EnableSnow             = globalWeather.EnableSnow;
            profileValues.m_pwSkyWeatherData.m_snowSettings.SnowCoverAlwaysEnabled = globalWeather.SnowCoverAlwaysEnabled;
            profileValues.m_pwSkyWeatherData.m_snowSettings.SnowIntensity          = globalWeather.SnowIntensity;
            profileValues.m_pwSkyWeatherData.m_snowSettings.SnowHeight             = globalWeather.SnowHeight;
            profileValues.m_pwSkyWeatherData.m_snowSettings.PermanentSnowHeight    = globalWeather.PermanentSnowHeight;
            profileValues.m_pwSkyWeatherData.m_snowSettings.SnowingHeight          = globalWeather.SnowingHeight;
            profileValues.m_pwSkyWeatherData.m_snowSettings.SnowFadeHeight         = globalWeather.SnowFadeHeight;
            profileValues.m_pwSkyWeatherData.m_snowSettings.m_snowStormChance      = globalWeather.m_snowStormChance;
            profileValues.m_pwSkyWeatherData.m_snowSettings.m_snowStepSize         = globalWeather.m_snowStepSize;
            profileValues.m_pwSkyWeatherData.m_snowSettings.m_snowMode             = globalWeather.m_snowMode;
            GaiaUtils.CopyFields(globalWeather.m_snowWeatherSettings, profileValues.m_pwSkyWeatherData.m_snowSettings.m_snowWeatherSettings);

            profileValues.m_pwSkyWeatherData.m_thunderSettings.m_enableThunder       = globalWeather.m_enableThunder;
            profileValues.m_pwSkyWeatherData.m_thunderSettings.ThunderWaitDuration   = globalWeather.ThunderWaitDuration;
            profileValues.m_pwSkyWeatherData.m_thunderSettings.m_thunderChance       = globalWeather.m_thunderChance;
            profileValues.m_pwSkyWeatherData.m_thunderSettings.ThunderLightColor     = globalWeather.ThunderLightColor;
            profileValues.m_pwSkyWeatherData.m_thunderSettings.ThunderLightIntensity = globalWeather.ThunderLightIntensity;
            profileValues.m_pwSkyWeatherData.m_thunderSettings.ThunderAudioSources   = globalWeather.ThunderAudioSources;
            profileValues.m_pwSkyWeatherData.m_thunderSettings.ThunderLightRadius    = globalWeather.ThunderLightRadius;
        }
示例#5
0
        public void SaveToGaiaDefault(GaiaLightingProfileValues profileValues, ProceduralWorldsGlobalWeather globalWeather)
        {
            if (profileValues == null)
            {
                return;
            }

            GaiaLightingProfileValues newProfileValues = new GaiaLightingProfileValues();

            GaiaUtils.CopyFields(profileValues, newProfileValues);
            newProfileValues.m_userCustomProfile = false;
#if UNITY_POST_PROCESSING_STACK_V2
            newProfileValues.PostProcessProfileBuiltIn          = profileValues.PostProcessProfileBuiltIn;
            newProfileValues.m_postProcessingProfileGUIDBuiltIn = profileValues.m_postProcessingProfileGUIDBuiltIn;
#endif
#if UPPipeline
            newProfileValues.PostProcessProfileURP          = profileValues.PostProcessProfileURP;
            newProfileValues.m_postProcessingProfileGUIDURP = profileValues.m_postProcessingProfileGUIDURP;
#endif
#if HDPipeline
            newProfileValues.PostProcessProfileHDRP          = profileValues.PostProcessProfileHDRP;
            newProfileValues.m_postProcessingProfileGUIDHDRP = profileValues.m_postProcessingProfileGUIDHDRP;
            newProfileValues.EnvironmentProfileHDRP          = profileValues.EnvironmentProfileHDRP;
            newProfileValues.m_environmentProfileGUIDHDRP    = profileValues.m_environmentProfileGUIDHDRP;
#endif

            GaiaSettings gaiaSettings = GaiaUtils.GetGaiaSettings();
            if (gaiaSettings != null)
            {
                GaiaLightingProfile lightingProfile = gaiaSettings.m_gaiaLightingProfile;
                if (lightingProfile != null)
                {
                    bool addProfile          = true;
                    int  indexForReplacement = 0;
                    for (int i = 0; i < lightingProfile.m_lightingProfiles.Count; i++)
                    {
                        if (lightingProfile.m_lightingProfiles[i].m_typeOfLighting == newProfileValues.m_typeOfLighting)
                        {
                            addProfile          = false;
                            indexForReplacement = i;
                        }
                    }

                    if (addProfile)
                    {
                        SavePWSkyAtmosphere(newProfileValues, globalWeather);
                        SavePWSeason(newProfileValues, globalWeather);
                        SavePWSkyCloud(newProfileValues, globalWeather);
                        SavePWSkyWeather(newProfileValues, globalWeather);
                        SavePWSkyWind(newProfileValues, globalWeather);
                        SaveColorAndCubemapFields(newProfileValues, profileValues);
                        lightingProfile.m_lightingProfiles.Add(newProfileValues);
                    }
                    else
                    {
                        #if UNITY_EDITOR
                        if (EditorUtility.DisplayDialog("Profile Already Exists", "This profile " + newProfileValues.m_typeOfLighting + " already exists the the default Gaia lighting profile. Do you want to replace this profile?", "Yes", "No"))
                        {
                            GaiaUtils.CopyFields(newProfileValues, lightingProfile.m_lightingProfiles[indexForReplacement]);
                            SavePWSkyAtmosphere(lightingProfile.m_lightingProfiles[indexForReplacement], globalWeather);
                            SavePWSeason(lightingProfile.m_lightingProfiles[indexForReplacement], globalWeather);
                            SavePWSkyCloud(lightingProfile.m_lightingProfiles[indexForReplacement], globalWeather);
                            SavePWSkyWeather(lightingProfile.m_lightingProfiles[indexForReplacement], globalWeather);
                            SavePWSkyWind(lightingProfile.m_lightingProfiles[indexForReplacement], globalWeather);
                            SaveColorAndCubemapFields(lightingProfile.m_lightingProfiles[indexForReplacement], profileValues);
#if UNITY_POST_PROCESSING_STACK_V2
                            lightingProfile.m_lightingProfiles[indexForReplacement].PostProcessProfileBuiltIn          = profileValues.PostProcessProfileBuiltIn;
                            lightingProfile.m_lightingProfiles[indexForReplacement].m_postProcessingProfileGUIDBuiltIn = profileValues.m_postProcessingProfileGUIDBuiltIn;
#endif
#if UPPipeline
                            lightingProfile.m_lightingProfiles[indexForReplacement].PostProcessProfileURP          = profileValues.PostProcessProfileURP;
                            lightingProfile.m_lightingProfiles[indexForReplacement].m_postProcessingProfileGUIDURP = profileValues.m_postProcessingProfileGUIDURP;
#endif
#if HDPipeline
                            lightingProfile.m_lightingProfiles[indexForReplacement].PostProcessProfileHDRP          = profileValues.PostProcessProfileHDRP;
                            lightingProfile.m_lightingProfiles[indexForReplacement].m_postProcessingProfileGUIDHDRP = profileValues.m_postProcessingProfileGUIDHDRP;
#endif
                        }
                        #endif
                    }

                    #if UNITY_EDITOR
                    EditorUtility.SetDirty(lightingProfile);
                    #endif

                    Debug.Log("Profile successfully added to the Gaia Lighting Profile. Remember to save your project to save the changes");
                }
            }
        }
示例#6
0
        public void SaveToGaiaDefault(GaiaWaterProfileValues profileValues)
        {
            if (profileValues == null)
            {
                return;
            }

            GaiaWaterProfileValues newProfileValues = new GaiaWaterProfileValues();

            GaiaUtils.CopyFields(profileValues, newProfileValues);
            newProfileValues.m_userCustomProfile = false;
#if UNITY_POST_PROCESSING_STACK_V2
            newProfileValues.PostProcessProfileBuiltIn          = profileValues.PostProcessProfileBuiltIn;
            newProfileValues.m_postProcessingProfileGUIDBuiltIn = profileValues.m_postProcessingProfileGUIDBuiltIn;
#endif
#if UPPipeline
            newProfileValues.PostProcessProfileURP          = profileValues.PostProcessProfileURP;
            newProfileValues.m_postProcessingProfileGUIDURP = profileValues.m_postProcessingProfileGUIDURP;
#endif
#if HDPipeline
            newProfileValues.PostProcessProfileHDRP          = profileValues.PostProcessProfileHDRP;
            newProfileValues.m_postProcessingProfileGUIDHDRP = profileValues.m_postProcessingProfileGUIDHDRP;
#endif

            GaiaSettings gaiaSettings = GaiaUtils.GetGaiaSettings();
            if (gaiaSettings != null)
            {
                GaiaWaterProfile waterProfile = gaiaSettings.m_gaiaWaterProfile;
                if (waterProfile != null)
                {
                    bool addProfile          = true;
                    int  indexForReplacement = 0;
                    for (int i = 0; i < waterProfile.m_waterProfiles.Count; i++)
                    {
                        if (waterProfile.m_waterProfiles[i].m_typeOfWater == newProfileValues.m_typeOfWater)
                        {
                            addProfile          = false;
                            indexForReplacement = i;
                        }
                    }

                    if (addProfile)
                    {
                        SaveColorAndCubemapFields(newProfileValues, profileValues);
                        waterProfile.m_waterProfiles.Add(newProfileValues);
                    }
                    else
                    {
                        #if UNITY_EDITOR
                        if (EditorUtility.DisplayDialog("Profile Already Exists", "This profile " + newProfileValues.m_typeOfWater + " already exists the the default Gaia water profile. Do you want to replace this profile?", "Yes", "No"))
                        {
                            GaiaUtils.CopyFields(newProfileValues, waterProfile.m_waterProfiles[indexForReplacement]);
                            SaveColorAndCubemapFields(waterProfile.m_waterProfiles[indexForReplacement], profileValues);
#if UNITY_POST_PROCESSING_STACK_V2
                            waterProfile.m_waterProfiles[indexForReplacement].PostProcessProfileBuiltIn          = profileValues.PostProcessProfileBuiltIn;
                            waterProfile.m_waterProfiles[indexForReplacement].m_postProcessingProfileGUIDBuiltIn = profileValues.m_postProcessingProfileGUIDBuiltIn;
#endif
#if UPPipeline
                            waterProfile.m_waterProfiles[indexForReplacement].PostProcessProfileURP          = profileValues.PostProcessProfileURP;
                            waterProfile.m_waterProfiles[indexForReplacement].m_postProcessingProfileGUIDURP = profileValues.m_postProcessingProfileGUIDURP;
#endif
#if HDPipeline
                            waterProfile.m_waterProfiles[indexForReplacement].PostProcessProfileHDRP          = profileValues.PostProcessProfileHDRP;
                            waterProfile.m_waterProfiles[indexForReplacement].m_postProcessingProfileGUIDHDRP = profileValues.m_postProcessingProfileGUIDHDRP;
#endif
                        }
                        #endif
                    }

                    #if UNITY_EDITOR
                    EditorUtility.SetDirty(waterProfile);
                    #endif

                    Debug.Log("Profile successfully added to the Gaia Water Profile. Remember to save your project to save the changes");
                }
            }
        }
示例#7
0
 public StampFeatureSettings(StampFeatureSettings original)
 {
     GaiaUtils.CopyFields(original, this);
     m_chanceStrengthMapping = new AnimationCurve(original.m_chanceStrengthMapping.keys);
 }