Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            sky.Profile = JEditorCommon.ScriptableObjectField <JSkyProfile>("Profile", sky.Profile);
            profile     = sky.Profile;
            if (sky.Profile == null)
            {
                return;
            }
            dnc = sky.GetComponent <JDayNightCycle>();

            DrawSceneReferencesGUI();
            EditorGUI.BeginChangeCheck();
            DrawSkyGUI();
            DrawStarsGUI();
            DrawSunGUI();
            DrawMoonGUI();
            DrawHorizonCloudGUI();
            DrawOverheadCloudGUI();
            DrawDetailOverlayGUI();
            DrawUtilitiesGUI();

            if (EditorGUI.EndChangeCheck())
            {
                profile.UpdateMaterialProperties();
                EditorUtility.SetDirty(sky);
                EditorUtility.SetDirty(profile);
            }

            DrawAddDayNightCycleGUI();
        }
Ejemplo n.º 2
0
        private void DrawAddDayNightCycleGUI()
        {
            JDayNightCycle cycle = sky.GetComponent <JDayNightCycle>();

            if (cycle != null)
            {
                return;
            }

            string label = "Day Night Cycle";
            string id    = "day-night-cycle" + sky.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                if (GUILayout.Button("Add Day Night Cycle"))
                {
                    sky.gameObject.AddComponent <JDayNightCycle>();
                }
            });
        }