コード例 #1
0
        private void DrawMoonGUI()
        {
            string label = "Moon";
            string id    = "moon" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.EnableMoon = EditorGUILayout.Toggle("Enable", profile.EnableMoon);
                if (profile.EnableMoon)
                {
                    profile.UseBakedMoon = EditorGUILayout.Toggle("Baked", profile.UseBakedMoon);
                }
                if (profile.EnableMoon && !profile.UseBakedMoon)
                {
                    profile.MoonTexture  = JEditorCommon.InlineTexture2DField("Texture", profile.MoonTexture, -1);
                    profile.MoonColor    = ColorField("Color", profile.MoonColor, true, true, true, nameof(profile.MoonColor));
                    profile.MoonSize     = Slider("Size", profile.MoonSize, 0f, 1f, nameof(profile.MoonSize));
                    profile.MoonSoftEdge = Slider("Soft Edge", profile.MoonSoftEdge, 0f, 1f, nameof(profile.MoonSoftEdge));
                    profile.MoonGlow     = Slider("Glow", profile.MoonGlow, 0f, 1f, nameof(profile.MoonGlow));
                }
                if (profile.EnableMoon && profile.UseBakedMoon)
                {
                    profile.MoonCubemap = JEditorCommon.InlineCubemapField("Cubemap", profile.MoonCubemap, -1);
                }
                if (profile.EnableMoon)
                {
                    profile.MoonLightColor     = ColorField("Light Color", profile.MoonLightColor, true, false, false, nameof(profile.MoonLightColor));
                    profile.MoonLightIntensity = FloatField("Light Intensity", profile.MoonLightIntensity, nameof(profile.MoonLightIntensity));
                }
            });
        }
コード例 #2
0
        private void DrawExportGUI()
        {
            string label = "Export";
            string id    = "export" + GetInstanceID();

            JEditorCommon.Foldout(label, true, id, () =>
            {
                CameraPosition  = JEditorCommon.InlineVector3Field("Position", CameraPosition);
                CameraNearPlane = EditorGUILayout.FloatField("Near Plane", CameraNearPlane);
                CameraFarPlane  = EditorGUILayout.FloatField("Far Plane", CameraFarPlane);
                CameraClearFlag = (CameraClearFlags)EditorGUILayout.EnumPopup("Clear Flags", CameraClearFlag);
                if (CameraClearFlag == CameraClearFlags.Color)
                {
                    CameraBackgroundColor = EditorGUILayout.ColorField("Background Color", CameraBackgroundColor);
                }

                Resolution         = EditorGUILayout.IntPopup("Resolution", Resolution, ResolutionLabels, ResolutionValues);
                ExportFaceTextures = EditorGUILayout.Toggle("Export Face Textures", ExportFaceTextures);

                string dir = Directory;
                JEditorCommon.BrowseFolder("Directory", ref dir);
                Directory = dir;

                GUI.enabled = !string.IsNullOrEmpty(Directory);
                if (GUILayout.Button("Export"))
                {
                    Export();
                }
                GUI.enabled = true;
            });
        }
コード例 #3
0
        private void DrawOverheadCloudGUI()
        {
            string label = "Overhead Cloud";
            string id    = "overhead-cloud" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.EnableOverheadCloud = EditorGUILayout.Toggle("Enable", profile.EnableOverheadCloud);
                if (profile.EnableOverheadCloud)
                {
                    profile.CustomCloudTexture    = JEditorCommon.InlineTexture2DField("Texture", profile.CustomCloudTexture, -1);
                    profile.OverheadCloudColor    = ColorField("Color", profile.OverheadCloudColor, true, true, false, nameof(profile.OverheadCloudColor));
                    profile.OverheadCloudAltitude = FloatField("Altitude", profile.OverheadCloudAltitude, nameof(profile.OverheadCloudAltitude));
                    profile.OverheadCloudSize     = FloatField("Size", profile.OverheadCloudSize, nameof(profile.OverheadCloudSize));
                    if (profile.AllowStepEffect)
                    {
                        profile.OverheadCloudStep = EditorGUILayout.IntField("Step", profile.OverheadCloudStep);
                    }
                    profile.OverheadCloudAnimationSpeed = FloatField("Animation Speed", profile.OverheadCloudAnimationSpeed, nameof(profile.OverheadCloudAnimationSpeed));
                    profile.OverheadCloudFlowDirectionX = Slider("Flow X", profile.OverheadCloudFlowDirectionX, -1, 1, nameof(profile.OverheadCloudFlowDirectionX));
                    profile.OverheadCloudFlowDirectionZ = Slider("Flow Z", profile.OverheadCloudFlowDirectionZ, -1, 1, nameof(profile.OverheadCloudFlowDirectionZ));
                    profile.OverheadCloudRemapMin       = FloatField("Remap Min", profile.OverheadCloudRemapMin, nameof(profile.OverheadCloudRemapMin));
                    profile.OverheadCloudRemapMax       = FloatField("Remap Max", profile.OverheadCloudRemapMax, nameof(profile.OverheadCloudRemapMax));
                    profile.OverheadCloudCastShadow     = EditorGUILayout.Toggle("Cast Shadow (Experimental)", profile.OverheadCloudCastShadow);
                    if (profile.OverheadCloudCastShadow)
                    {
                        profile.OverheadCloudShadowClipMask = EditorGUILayout.Slider("Clip Mask", profile.OverheadCloudShadowClipMask, 0f, 1f);
                    }
                }
            });
        }
コード例 #4
0
ファイル: JSkyInspector.cs プロジェクト: ComradeCrunchy/Ranch
        private void DrawSunGUI()
        {
            string label = "Sun";
            string id    = "sun" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.EnableSun = EditorGUILayout.Toggle("Enable", profile.EnableSun);
                if (profile.EnableSun)
                {
                    profile.UseBakedSun = EditorGUILayout.Toggle("Baked", profile.UseBakedSun);
                }
                if (profile.EnableSun && !profile.UseBakedSun)
                {
                    profile.SunTexture  = JEditorCommon.InlineTexture2DField("Texture", profile.SunTexture, -1);
                    profile.SunColor    = EditorGUILayout.ColorField(new GUIContent("Color"), profile.SunColor, true, true, true);
                    profile.SunSize     = EditorGUILayout.Slider("Size", profile.SunSize, 0f, 1f);
                    profile.SunSoftEdge = EditorGUILayout.Slider("Soft Edge", profile.SunSoftEdge, 0f, 1f);
                    profile.SunGlow     = EditorGUILayout.Slider("Glow", profile.SunGlow, 0f, 1f);
                }
                if (profile.EnableSun && profile.UseBakedSun)
                {
                    profile.SunCubemap = JEditorCommon.InlineCubemapField("Cubemap", profile.SunCubemap, -1);
                }
                if (profile.EnableSun)
                {
                    profile.SunLightColor     = EditorGUILayout.ColorField("Light Color", profile.SunLightColor);
                    profile.SunLightIntensity = EditorGUILayout.FloatField("Light Intensity", profile.SunLightIntensity);
                }
            });
        }
コード例 #5
0
        private void DrawMoonGUI()
        {
            string label = "Moon";
            string id    = "moon" + instance.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                instance.EnableMoon = EditorGUILayout.Toggle("Enable", instance.EnableMoon);
                if (instance.EnableMoon)
                {
                    instance.UseBakedMoon = EditorGUILayout.Toggle("Baked", instance.UseBakedMoon);
                }
                if (instance.EnableMoon && !instance.UseBakedMoon)
                {
                    instance.MoonTexture  = JEditorCommon.InlineTexture2DField("Texture", instance.MoonTexture, -1);
                    instance.MoonColor    = EditorGUILayout.ColorField(new GUIContent("Color"), instance.MoonColor, true, true, true);
                    instance.MoonSize     = EditorGUILayout.Slider("Size", instance.MoonSize, 0f, 1f);
                    instance.MoonSoftEdge = EditorGUILayout.Slider("Soft Edge", instance.MoonSoftEdge, 0f, 1f);
                    instance.MoonGlow     = EditorGUILayout.Slider("Glow", instance.MoonGlow, 0f, 1f);
                }
                if (instance.EnableMoon && instance.UseBakedMoon)
                {
                    instance.MoonCubemap = JEditorCommon.InlineCubemapField("Cubemap", instance.MoonCubemap, -1);
                }
                if (instance.EnableMoon)
                {
                    instance.MoonLightColor     = EditorGUILayout.ColorField("Light Color", instance.MoonLightColor);
                    instance.MoonLightIntensity = EditorGUILayout.FloatField("Light Intensity", instance.MoonLightIntensity);
                }
            });
        }
コード例 #6
0
        private void DrawUtilitiesGUI()
        {
            string label = "Utilities";
            string id    = "utilities" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.AllowStepEffect = EditorGUILayout.Toggle("Allow Step Effect", profile.AllowStepEffect);
            });
        }
コード例 #7
0
        private void DrawSceneReferencesGUI()
        {
            string label = "Scene References";
            string id    = "scene-ref" + cycle.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                cycle.Sky           = EditorGUILayout.ObjectField("Sky", cycle.Sky, typeof(JSky), true) as JSky;
                cycle.SunOrbitPivot = EditorGUILayout.ObjectField("Orbit Pivot", cycle.SunOrbitPivot, typeof(Transform), true) as Transform;
            });
        }
コード例 #8
0
        private void DrawSceneReferencesGUI()
        {
            string label = "Scene References";
            string id    = "scene-references";

            JEditorCommon.Foldout(label, false, id, () =>
            {
                sky.SunLightSource  = EditorGUILayout.ObjectField("Sun Light Source", sky.SunLightSource, typeof(Light), true) as Light;
                sky.MoonLightSource = EditorGUILayout.ObjectField("Moon Light Source", sky.MoonLightSource, typeof(Light), true) as Light;
            });
        }
コード例 #9
0
        private void DrawStarsGUI()
        {
            string label = "Stars";
            string id    = "stars" + profile.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                DisplayAddedProperties("Stars");
                if (GUILayout.Button("Add"))
                {
                    DisplayAllPropertiesAsContext("Stars");
                }
            });
        }
コード例 #10
0
        private void DrawOverheadCloudGUI()
        {
            string label = "Overhead Cloud";
            string id    = "overhead-cloud" + profile.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                DisplayAddedProperties("Overhead Cloud");
                if (GUILayout.Button("Add"))
                {
                    DisplayAllPropertiesAsContext("Overhead Cloud");
                }
            });
        }
コード例 #11
0
        private void DrawMoonGUI()
        {
            string label = "Moon";
            string id    = "moon" + instance.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                DisplayAddedProperties("Moon");
                if (GUILayout.Button("Add"))
                {
                    DisplayAllPropertiesAsContext("Moon");
                }
            });
        }
コード例 #12
0
        private void DrawDetailOverlayGUI()
        {
            string label = "Detail Overlay";
            string id    = "detail-overlay" + profile.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                DisplayAddedProperties("Detail Overlay");
                if (GUILayout.Button("Add"))
                {
                    DisplayAllPropertiesAsContext("Detail Overlay");
                }
            });
        }
コード例 #13
0
        private void DrawHorizonCloudGUI()
        {
            string label = "Horizon Cloud";
            string id    = "horizon-cloud" + instance.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                DisplayAddedProperties("Horizon Cloud");
                if (GUILayout.Button("Add"))
                {
                    DisplayAllPropertiesAsContext("Horizon Cloud");
                }
            });
        }
コード例 #14
0
        private void DrawTimeGUI()
        {
            string label = "Time";
            string id    = "time" + cycle.GetInstanceID();

            isTimeFoldoutExpanded = JEditorCommon.Foldout(label, false, id, () =>
            {
                cycle.StartTime         = EditorGUILayout.FloatField("Start Time", cycle.StartTime);
                cycle.TimeIncrement     = EditorGUILayout.FloatField("Time Increment", cycle.TimeIncrement);
                GUI.enabled             = !cycle.AutoTimeIncrement;
                cycle.Time              = EditorGUILayout.Slider("Time", cycle.Time, 0f, 24f);
                GUI.enabled             = true;
                cycle.AutoTimeIncrement = EditorGUILayout.Toggle("Auto", cycle.AutoTimeIncrement);
            });
        }
コード例 #15
0
        private void DrawEnvironmentReflectionGUI()
        {
            string label = "Environment Reflection";
            string id    = "env-reflection";

            JEditorCommon.Foldout(label, false, id, () =>
            {
                cycle.ShouldUpdateEnvironmentReflection = EditorGUILayout.Toggle("Enable", cycle.ShouldUpdateEnvironmentReflection);
                if (cycle.ShouldUpdateEnvironmentReflection)
                {
                    cycle.EnvironmentReflectionResolution      = EditorGUILayout.IntPopup("Resolution", cycle.EnvironmentReflectionResolution, resolutionLabels, resolutionValues);
                    cycle.EnvironmentReflectionTimeSlicingMode = (ReflectionProbeTimeSlicingMode)EditorGUILayout.EnumPopup("Time Slicing", cycle.EnvironmentReflectionTimeSlicingMode);
                    EditorGUILayout.LabelField("Realtime Reflection Probe must be enabled in Quality Settings.", JEditorCommon.WordWrapItalicLabel);
                }
            });
        }
コード例 #16
0
        private void DrawDetailOverlayGUI()
        {
            string label = "Detail Overlay";
            string id    = "detail-overlay" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.EnableDetailOverlay = EditorGUILayout.Toggle("Enable", profile.EnableDetailOverlay);
                if (profile.EnableDetailOverlay)
                {
                    profile.DetailOverlayTintColor     = ColorField("Color", profile.DetailOverlayTintColor, true, true, false, nameof(profile.DetailOverlayTintColor));
                    profile.DetailOverlayCubeMap       = JEditorCommon.InlineCubemapField("Cubemap", profile.DetailOverlayCubeMap, -1);
                    profile.DetailOverlayLayer         = (JDetailOverlayLayer)EditorGUILayout.EnumPopup("Layer", profile.DetailOverlayLayer);
                    profile.DetailOverlayRotationSpeed = FloatField("Rotation Speed", profile.DetailOverlayRotationSpeed, nameof(profile.DetailOverlayRotationSpeed));
                }
            });
        }
コード例 #17
0
        private void DrawSkyGUI()
        {
            string label = "Sky";
            string id    = "sky" + instance.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                instance.SkyColor     = EditorGUILayout.ColorField("Sky Color", instance.SkyColor);
                instance.HorizonColor = EditorGUILayout.ColorField("Horizon Color", instance.HorizonColor);
                instance.GroundColor  = EditorGUILayout.ColorField("Ground Color", instance.GroundColor);
                if (instance.AllowStepEffect)
                {
                    instance.HorizonStep = EditorGUILayout.IntField("Horizon Step", instance.HorizonStep);
                }
                instance.HorizonExponent  = EditorGUILayout.FloatField("Horizon Exponent", instance.HorizonExponent);
                instance.HorizonThickness = EditorGUILayout.Slider("Horizon Thickness", instance.HorizonThickness, 0f, 1f);
            });
        }
コード例 #18
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>();
                }
            });
        }
コード例 #19
0
        private void DrawMoonGUI()
        {
            string label = "Moon";
            string id    = "moon" + profile.GetInstanceID();

            JEditorCommon.Foldout(label, false, id, () =>
            {
                cycle.UseMoonPivot = EditorGUILayout.Toggle("Custom Pivot", cycle.UseMoonPivot);
                if (cycle.UseMoonPivot)
                {
                    cycle.MoonOrbitPivot = EditorGUILayout.ObjectField("Pivot", cycle.MoonOrbitPivot, typeof(Transform), true) as Transform;
                }
                JEditorCommon.Separator();

                DisplayAddedProperties("Moon");
                if (GUILayout.Button("Add"))
                {
                    DisplayAllPropertiesAsContext("Moon");
                }
            });
        }
コード例 #20
0
        private void DrawSkyGUI()
        {
            string label = "Sky";
            string id    = "sky" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.SkyColor     = ColorField("Sky Color", profile.SkyColor, true, true, true, nameof(profile.SkyColor));
                profile.HorizonColor = ColorField("Horizon Color", profile.HorizonColor, true, true, true, nameof(profile.HorizonColor));
                profile.GroundColor  = ColorField("Ground Color", profile.GroundColor, true, true, true, nameof(profile.GroundColor));
                if (profile.AllowStepEffect)
                {
                    profile.HorizonStep = EditorGUILayout.IntField("Horizon Step", profile.HorizonStep);
                }
                profile.HorizonExponent  = FloatField("Horizon Exponent", profile.HorizonExponent, nameof(profile.HorizonExponent));
                profile.HorizonThickness = Slider("Horizon Thickness", profile.HorizonThickness, 0f, 1f, nameof(profile.HorizonThickness));
                profile.FogSyncOption    = (JFogSyncOption)EditorGUILayout.EnumPopup("Fog Sync", profile.FogSyncOption);
                if (profile.FogSyncOption == JFogSyncOption.CustomColor)
                {
                    profile.FogColor = ColorField("Fog Color", profile.FogColor, true, true, false, nameof(profile.FogColor));
                }
            });
        }
コード例 #21
0
        private void DrawHorizonCloudGUI()
        {
            string label = "Horizon Cloud";
            string id    = "horizon-cloud" + instance.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                instance.EnableHorizonCloud = EditorGUILayout.Toggle("Enable", instance.EnableHorizonCloud);
                if (instance.EnableHorizonCloud)
                {
                    instance.CustomCloudTexture        = JEditorCommon.InlineTexture2DField("Texture", instance.CustomCloudTexture, -1);
                    instance.HorizonCloudColor         = EditorGUILayout.ColorField("Color", instance.HorizonCloudColor);
                    instance.HorizonCloudStartPosition = EditorGUILayout.Slider("Start", instance.HorizonCloudStartPosition, -1, 1);
                    instance.HorizonCloudEndPosition   = EditorGUILayout.Slider("End", instance.HorizonCloudEndPosition, -1, 1);
                    instance.HorizonCloudSize          = EditorGUILayout.FloatField("Size", instance.HorizonCloudSize);
                    if (instance.AllowStepEffect)
                    {
                        instance.HorizonCloudStep = EditorGUILayout.IntField("Step", instance.HorizonCloudStep);
                    }
                    instance.HorizonCloudAnimationSpeed = EditorGUILayout.FloatField("Animation Speed", instance.HorizonCloudAnimationSpeed);
                }
            });
        }
コード例 #22
0
        private void DrawHorizonCloudGUI()
        {
            string label = "Horizon Cloud";
            string id    = "horizon-cloud" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.EnableHorizonCloud = EditorGUILayout.Toggle("Enable", profile.EnableHorizonCloud);
                if (profile.EnableHorizonCloud)
                {
                    profile.CustomCloudTexture        = JEditorCommon.InlineTexture2DField("Texture", profile.CustomCloudTexture, -1);
                    profile.HorizonCloudColor         = ColorField("Color", profile.HorizonCloudColor, true, true, false, nameof(profile.HorizonCloudColor));
                    profile.HorizonCloudStartPosition = Slider("Start", profile.HorizonCloudStartPosition, -1, 1, nameof(profile.HorizonCloudStartPosition));
                    profile.HorizonCloudEndPosition   = Slider("End", profile.HorizonCloudEndPosition, -1, 1, nameof(profile.HorizonCloudEndPosition));
                    profile.HorizonCloudSize          = FloatField("Size", profile.HorizonCloudSize, nameof(profile.HorizonCloudSize));
                    if (profile.AllowStepEffect)
                    {
                        profile.HorizonCloudStep = EditorGUILayout.IntField("Step", profile.HorizonCloudStep);
                    }
                    profile.HorizonCloudAnimationSpeed = FloatField("Animation Speed", profile.HorizonCloudAnimationSpeed, nameof(profile.HorizonCloudAnimationSpeed));
                }
            });
        }
コード例 #23
0
ファイル: JSkyInspector.cs プロジェクト: ComradeCrunchy/Ranch
        private void DrawOverheadCloudGUI()
        {
            string label = "Overhead Cloud";
            string id    = "overhead-cloud" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.EnableOverheadCloud = EditorGUILayout.Toggle("Enable", profile.EnableOverheadCloud);
                if (profile.EnableOverheadCloud)
                {
                    profile.CustomCloudTexture    = JEditorCommon.InlineTexture2DField("Texture", profile.CustomCloudTexture, -1);
                    profile.OverheadCloudColor    = EditorGUILayout.ColorField("Color", profile.OverheadCloudColor);
                    profile.OverheadCloudAltitude = EditorGUILayout.FloatField("Altitude", profile.OverheadCloudAltitude);
                    profile.OverheadCloudSize     = EditorGUILayout.FloatField("Size", profile.OverheadCloudSize);
                    if (profile.AllowStepEffect)
                    {
                        profile.OverheadCloudStep = EditorGUILayout.IntField("Step", profile.OverheadCloudStep);
                    }
                    profile.OverheadCloudAnimationSpeed = EditorGUILayout.FloatField("Animation Speed", profile.OverheadCloudAnimationSpeed);
                    profile.OverheadCloudFlowDirectionX = EditorGUILayout.Slider("Flow X", profile.OverheadCloudFlowDirectionX, -1, 1);
                    profile.OverheadCloudFlowDirectionZ = EditorGUILayout.Slider("Flow Z", profile.OverheadCloudFlowDirectionZ, -1, 1);
                }
            });
        }
コード例 #24
0
        private void DrawStarsGUI()
        {
            string label = "Stars";
            string id    = "stars" + profile.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                profile.EnableStars = EditorGUILayout.Toggle("Enable", profile.EnableStars);
                if (profile.EnableStars)
                {
                    profile.UseBakedStars = EditorGUILayout.Toggle("Baked", profile.UseBakedStars);
                }
                if (profile.EnableStars && !profile.UseBakedStars)
                {
                    profile.StarsStartPosition = Slider("Start", profile.StarsStartPosition, -1, 1, nameof(profile.StarsStartPosition));
                    profile.StarsEndPosition   = Slider("End", profile.StarsEndPosition, -1, 1, nameof(profile.StarsEndPosition));
                    profile.StarsOpacity       = Slider("Opacity", profile.StarsOpacity, 0f, 1f, nameof(profile.StarsOpacity));
                    profile.StarsLayerCount    = EditorGUILayout.DelayedIntField("Layers", profile.StarsLayerCount);

                    if (profile.StarsLayerCount > 0)
                    {
                        JEditorCommon.Separator();
                        EditorGUILayout.LabelField("Layer 0");
                        EditorGUI.indentLevel += 1;
                        profile.StarsColor0    = ColorField("Color", profile.StarsColor0, true, true, true, nameof(profile.StarsColor0));
                        profile.StarsDensity0  = Slider("Density", profile.StarsDensity0, 0.01f, 1f, nameof(profile.StarsDensity0));
                        profile.StarsSize0     = Slider("Size", profile.StarsSize0, 0.01f, 1f, nameof(profile.StarsSize0));
                        profile.StarsGlow0     = Slider("Glow", profile.StarsGlow0, 0f, 1f, nameof(profile.StarsGlow0));
                        profile.StarsTwinkle0  = FloatField("Twinkle", profile.StarsTwinkle0, nameof(profile.StarsTwinkle0));
                        EditorGUI.indentLevel -= 1;
                    }

                    if (profile.StarsLayerCount > 1)
                    {
                        JEditorCommon.Separator();
                        EditorGUILayout.LabelField("Layer 1");
                        EditorGUI.indentLevel += 1;
                        profile.StarsColor1    = ColorField("Color", profile.StarsColor1, true, true, true, nameof(profile.StarsColor1));
                        profile.StarsDensity1  = Slider("Density", profile.StarsDensity1, 0.01f, 1f, nameof(profile.StarsDensity1));
                        profile.StarsSize1     = Slider("Size", profile.StarsSize1, 0.01f, 1f, nameof(profile.StarsSize1));
                        profile.StarsGlow1     = Slider("Glow", profile.StarsGlow1, 0f, 1f, nameof(profile.StarsGlow1));
                        profile.StarsTwinkle1  = FloatField("Twinkle", profile.StarsTwinkle1, nameof(profile.StarsTwinkle1));
                        EditorGUI.indentLevel -= 1;
                    }

                    if (profile.StarsLayerCount > 2)
                    {
                        JEditorCommon.Separator();
                        EditorGUILayout.LabelField("Layer 2");
                        EditorGUI.indentLevel += 1;
                        profile.StarsColor2    = ColorField("Color", profile.StarsColor2, true, true, true, nameof(profile.StarsColor2));
                        profile.StarsDensity2  = Slider("Density", profile.StarsDensity2, 0.01f, 1f, nameof(profile.StarsDensity2));
                        profile.StarsSize2     = Slider("Size", profile.StarsSize2, 0.01f, 1f, nameof(profile.StarsSize2));
                        profile.StarsGlow2     = Slider("Glow", profile.StarsGlow2, 0f, 1f, nameof(profile.StarsGlow2));
                        profile.StarsTwinkle2  = FloatField("Twinkle", profile.StarsTwinkle2, nameof(profile.StarsTwinkle2));
                        EditorGUI.indentLevel -= 1;
                    }
                }
                if (profile.EnableStars && profile.UseBakedStars)
                {
                    profile.StarsCubemap    = JEditorCommon.InlineCubemapField("Cubemap", profile.StarsCubemap, -1);
                    profile.StarsTwinkleMap = JEditorCommon.InlineTexture2DField("Twinkle Map", profile.StarsTwinkleMap, -1);
                    profile.StarsOpacity    = Slider("Opacity", profile.StarsOpacity, 0f, 1f, nameof(profile.StarsOpacity));
                }
            });
        }
コード例 #25
0
        private void DrawStarsGUI()
        {
            string label = "Stars";
            string id    = "stars" + instance.GetInstanceID();;

            JEditorCommon.Foldout(label, false, id, () =>
            {
                instance.EnableStars = EditorGUILayout.Toggle("Enable", instance.EnableStars);
                if (instance.EnableStars)
                {
                    instance.UseBakedStars = EditorGUILayout.Toggle("Baked", instance.UseBakedStars);
                }
                if (instance.EnableStars && !instance.UseBakedStars)
                {
                    instance.StarsStartPosition = EditorGUILayout.Slider("Start", instance.StarsStartPosition, -1, 1);
                    instance.StarsEndPosition   = EditorGUILayout.Slider("End", instance.StarsEndPosition, -1, 1);
                    instance.StarsOpacity       = EditorGUILayout.Slider("Opacity", instance.StarsOpacity, 0f, 1f);
                    instance.StarsLayerCount    = EditorGUILayout.DelayedIntField("Layers", instance.StarsLayerCount);

                    if (instance.StarsLayerCount > 0)
                    {
                        JEditorCommon.Separator();
                        EditorGUILayout.LabelField("Layer 0");
                        EditorGUI.indentLevel += 1;
                        instance.StarsColor0   = EditorGUILayout.ColorField(new GUIContent("Color"), instance.StarsColor0, true, true, true);
                        instance.StarsDensity0 = EditorGUILayout.Slider("Density", instance.StarsDensity0, 0.01f, 1f);
                        instance.StarsSize0    = EditorGUILayout.Slider("Size", instance.StarsSize0, 0.01f, 1f);
                        instance.StarsGlow0    = EditorGUILayout.Slider("Glow", instance.StarsGlow0, 0f, 1f);
                        instance.StarsTwinkle0 = EditorGUILayout.FloatField("Twinkle", instance.StarsTwinkle0);
                        EditorGUI.indentLevel -= 1;
                    }

                    if (instance.StarsLayerCount > 1)
                    {
                        JEditorCommon.Separator();
                        EditorGUILayout.LabelField("Layer 1");
                        EditorGUI.indentLevel += 1;
                        instance.StarsColor1   = EditorGUILayout.ColorField(new GUIContent("Color"), instance.StarsColor1, true, true, true);
                        instance.StarsDensity1 = EditorGUILayout.Slider("Density", instance.StarsDensity1, 0.01f, 1f);
                        instance.StarsSize1    = EditorGUILayout.Slider("Size", instance.StarsSize1, 0.01f, 1f);
                        instance.StarsGlow1    = EditorGUILayout.Slider("Glow", instance.StarsGlow1, 0f, 1f);
                        instance.StarsTwinkle1 = EditorGUILayout.FloatField("Twinkle", instance.StarsTwinkle1);
                        EditorGUI.indentLevel -= 1;
                    }

                    if (instance.StarsLayerCount > 2)
                    {
                        JEditorCommon.Separator();
                        EditorGUILayout.LabelField("Layer 2");
                        EditorGUI.indentLevel += 1;
                        instance.StarsColor2   = EditorGUILayout.ColorField(new GUIContent("Color"), instance.StarsColor2, true, true, true);
                        instance.StarsDensity2 = EditorGUILayout.Slider("Density", instance.StarsDensity2, 0.01f, 1f);
                        instance.StarsSize2    = EditorGUILayout.Slider("Size", instance.StarsSize2, 0.01f, 1f);
                        instance.StarsGlow2    = EditorGUILayout.Slider("Glow", instance.StarsGlow2, 0f, 1f);
                        instance.StarsTwinkle2 = EditorGUILayout.FloatField("Twinkle", instance.StarsTwinkle2);
                        EditorGUI.indentLevel -= 1;
                    }
                }
                if (instance.EnableStars && instance.UseBakedStars)
                {
                    instance.StarsCubemap    = JEditorCommon.InlineCubemapField("Cubemap", instance.StarsCubemap, -1);
                    instance.StarsTwinkleMap = JEditorCommon.InlineTexture2DField("Twinkle Map", instance.StarsTwinkleMap, -1);
                    instance.StarsOpacity    = EditorGUILayout.Slider("Opacity", instance.StarsOpacity, 0f, 1f);
                }
            });
        }