Ejemplo n.º 1
0
    private void OnGUI()
    {
#if UNITY_EDITOR
        if (Application.isPlaying)
        {
            GUILayout.BeginArea(new Rect(240, 10, 300, m_showFoldout ? 300 : 30));
            GUILayout.BeginVertical((GUIStyle)("Box"));

            m_showFoldout = EditorGUILayout.Foldout(m_showFoldout, "Weather (" + m_stormIntensity.ToString("0.0") + ")");


            if (m_showFoldout)
            {
                GUILayout.BeginVertical((GUIStyle)("Box"));

                GUILayout.BeginVertical((GUIStyle)("Box"));

                m_randomUpdate = GUILayout.Toggle(m_randomUpdate, "Random Intensity");

                GUI.enabled = m_randomUpdate;
                GUILayout.Label("Lerp Values : " + m_lerpStart.ToString("0.00") + ", " + m_lerpEnd.ToString("0.00") + " (" + m_lerpProgress.ToString("0.00") + ")");
                GUI.enabled = !m_randomUpdate;

                GUILayout.EndVertical();

                GUILayout.BeginHorizontal();

                GUILayout.Label("Storm Intensity", GUILayout.Width(120));

                float stormIntensity = GUILayout.HorizontalSlider(m_stormIntensity, 0.0f, 1.0f);

                if (stormIntensity != m_stormIntensity)
                {
                    SetStormIntensity(stormIntensity);
                }

                GUILayout.Label(m_stormIntensity.ToString("0.0"));

                GUILayout.EndHorizontal();

                GUILayout.EndVertical();

                GUILayout.BeginVertical((GUIStyle)("Box"));

                GUILayout.BeginHorizontal();

                GUILayout.Label("Cloud Cover", GUILayout.Width(120));
                CloudCover = GUILayout.HorizontalSlider(CloudCover, 0.0f, 1.0f);
                GUILayout.Label(CloudCover.ToString("0.0"));

                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();

                GUILayout.Label("Overlay Alpha", GUILayout.Width(120));
                float newAlpha = GUILayout.HorizontalSlider(m_overlayAlpha, 0.0f, 1.0f);
                if (newAlpha != m_overlayAlpha && m_overlayRenderer != null)
                {
                    SetOverlayAlpha(newAlpha);
                }

                GUILayout.Label(m_overlayAlpha.ToString("0.0"));

                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();

                GUILayout.Label("Particle Intensity", GUILayout.Width(120));
                float newParticleIntensity = GUILayout.HorizontalSlider(m_particleIntensity, 0.0f, 1.0f);
                if (newParticleIntensity != m_particleIntensity)
                {
                    SetParticleIntensity(newParticleIntensity);
                }

                GUILayout.Label(m_particleIntensity.ToString("0.0"));

                GUILayout.EndHorizontal();

                m_showParticlesFoldout = EditorGUILayout.Foldout(m_showParticlesFoldout, "Particle Settings");

                GUILayout.EndVertical();
                GUI.enabled = true;
            }

            GUILayout.EndVertical();

            GUILayout.EndArea();
        }
#endif
    }
Ejemplo n.º 2
0
 public string GetCloudCover()
 {
     return(cloudCover.ToString());
 }