Esempio n. 1
0
        public override void OnInspectorGUI(Terrain terrain, IOnInspectorGUI editContext)
        {
            if (m_HardnessNoiseSettings == null)
            {
                m_HardnessNoiseSettings = ScriptableObject.CreateInstance <NoiseSettings>();
                m_HardnessNoiseSettings.Reset();
            }



            Erosion.HydraulicErosionSettings erosionSettings = ((Erosion.HydraulicEroder)m_Eroder).m_ErosionSettings;

            EditorGUI.BeginChangeCheck();

            commonUI.OnInspectorGUI(terrain, editContext);

            m_Eroder.OnInspectorGUI(terrain, editContext);

            commonUI.validationMessage = ValidateAndGenerateUserMessage(terrain);

            if (EditorGUI.EndChangeCheck())
            {
                Save(true);
            }
        }
Esempio n. 2
0
        private void ResetRevertCallback()
        {
            Undo.RecordObject(m_noiseUpdateTarget, "NoiseWindow - Reset or Revert Settings");

            if (m_noiseSourceAsset == null)
            {
                m_noiseUpdateTarget.Reset();
            }
            else
            {
                m_noiseUpdateTarget.Copy(m_noiseSourceAsset);
            }
        }
Esempio n. 3
0
        public void OnInspectorGUI(Terrain terrain, IOnInspectorGUI editContext)
        {
            if (m_noiseSettings == null)
            {
                m_noiseSettings = ScriptableObject.CreateInstance <NoiseSettings>();
                m_noiseSettings.Reset();
            }

            if (m_noiseSettingsGUI == null)
            {
                m_noiseSettingsGUI = new NoiseSettingsGUI();
                m_noiseSettingsGUI.Init(m_noiseSettings);
            }

            m_noiseSettingsGUI.OnGUI(NoiseSettingsGUIFlags.Settings);
        }