示例#1
0
        //---------------------------------------------------------------------
        // Messages
        //---------------------------------------------------------------------

        protected void OnEnable()
        {
            _guiContent          = new GUIContent();
            _skyParamsLabel      = new GUIContent("Sky Dot Params", TOOLTIP_SKY);
            _starsParamsLabel    = new GUIContent("Stars Dot Params", TOOLTIP_STARS);
            _sunParamsLabel      = new GUIContent("Sun Dot Params", TOOLTIP_SUN);
            _moonParamsLabel     = new GUIContent("Moon Dot Params", TOOLTIP_MOON);
            _cloudsParamsLabel   = new GUIContent("Clouds Dot Params", TOOLTIP_CLOUDS);
            _framesIntervalLabel = new GUIContent("Frames Interval", "Reduce the skybox day-night cycle update to run every \"n\" frames");

            // Sky
            _skyDotParams = serializedObject.FindProperty("_skyParamsList").FindPropertyRelative("Params");
            // Stars
            _starsDotParams = serializedObject.FindProperty("_starsParamsList").FindPropertyRelative("Params");
            // Sun
            _sunrise      = serializedObject.FindProperty("_sunrise");
            _sunset       = serializedObject.FindProperty("_sunset");
            _sunAltitude  = serializedObject.FindProperty("_sunAltitude");
            _sunLongitude = serializedObject.FindProperty("_sunLongitude");
            _sunOrbit     = serializedObject.FindProperty("_sunOrbit");
            _sunDotParams = serializedObject.FindProperty("_sunParamsList").FindPropertyRelative("Params");
            // Moon
            _moonrise      = serializedObject.FindProperty("_moonrise");
            _moonset       = serializedObject.FindProperty("_moonset");
            _moonAltitude  = serializedObject.FindProperty("_moonAltitude");
            _moonLongitude = serializedObject.FindProperty("_moonLongitude");
            _moonOrbit     = serializedObject.FindProperty("_moonOrbit");
            _moonDotParams = serializedObject.FindProperty("_moonParamsList").FindPropertyRelative("Params");
            // Clouds
            _cloudsDotParams = serializedObject.FindProperty("_cloudsParamsList").FindPropertyRelative("Params");
            // General
            _framesInterval = serializedObject.FindProperty("_framesInterval");

            // Icons
            var skinFolder = (EditorGUIUtility.isProSkin) ? "Professional/" : "Personal/";

            var starsTex   = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Star_16.png");
            var skyTex     = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Sky_16.png");
            var sunTex     = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Sun_16.png");
            var moonTex    = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Moon_16.png");
            var cloudsTex  = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Cloud_16.png");
            var generalTex = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Tag_16.png");

            _starsIcon   = new GUIContent(starsTex);
            _skyIcon     = new GUIContent(skyTex);
            _sunIcon     = new GUIContent(sunTex);
            _moonIcon    = new GUIContent(moonTex);
            _cloudsIcon  = new GUIContent(cloudsTex);
            _generalIcon = new GUIContent(generalTex);
        }
示例#2
0
        //---------------------------------------------------------------------
        // Messages
        //---------------------------------------------------------------------

        protected void OnEnable()
        {
            _guiContent        = new GUIContent();
            _skyParamsLabel    = new GUIContent("Sky Dot Params", TOOLTIP_SKY);
            _starsParamsLabel  = new GUIContent("Stars Dot Params", TOOLTIP_STARS);
            _sunParamsLabel    = new GUIContent("Sun Dot Params", TOOLTIP_SUN);
            _moonParamsLabel   = new GUIContent("Moon Dot Params", TOOLTIP_MOON);
            _cloudsParamsLabel = new GUIContent("Clouds Dot Params", TOOLTIP_CLOUDS);

            // Sky
            _skyDotParams = serializedObject.FindProperty("_skyParamsList").FindPropertyRelative("Params");
            // Stars
            _starsDotParams = serializedObject.FindProperty("_starsParamsList").FindPropertyRelative("Params");
            // Sun
            _sunrise      = serializedObject.FindProperty("_sunrise");
            _sunset       = serializedObject.FindProperty("_sunset");
            _sunAltitude  = serializedObject.FindProperty("_sunAltitude");
            _sunLongitude = serializedObject.FindProperty("_sunLongitude");
            _sunOrbit     = serializedObject.FindProperty("_sunOrbit");
            _sunDotParams = serializedObject.FindProperty("_sunParamsList").FindPropertyRelative("Params");
            // Moon
            _moonrise      = serializedObject.FindProperty("_moonrise");
            _moonset       = serializedObject.FindProperty("_moonset");
            _moonAltitude  = serializedObject.FindProperty("_moonAltitude");
            _moonLongitude = serializedObject.FindProperty("_moonLongitude");
            _moonOrbit     = serializedObject.FindProperty("_moonOrbit");
            _moonDotParams = serializedObject.FindProperty("_moonParamsList").FindPropertyRelative("Params");
            // Clouds
            _cloudsDotParams = serializedObject.FindProperty("_cloudsParamsList").FindPropertyRelative("Params");

            // Icons
            var skinFolder  = (EditorGUIUtility.isProSkin) ? "Professional/" : "Personal/";
            var iconsFolder = ICONS_FOLDER + skinFolder;

            var starsTex  = FarlandSkiesEditorUtility.LoadFromAsset <Texture2D>(iconsFolder + "Star_16.png");
            var skyTex    = FarlandSkiesEditorUtility.LoadFromAsset <Texture2D>(iconsFolder + "Sky_16.png");
            var sunTex    = FarlandSkiesEditorUtility.LoadFromAsset <Texture2D>(iconsFolder + "Sun_16.png");
            var moonTex   = FarlandSkiesEditorUtility.LoadFromAsset <Texture2D>(iconsFolder + "Moon_16.png");
            var cloudsTex = FarlandSkiesEditorUtility.LoadFromAsset <Texture2D>(iconsFolder + "Cloud_16.png");

            _starsIcon  = new GUIContent(starsTex);
            _skyIcon    = new GUIContent(skyTex);
            _sunIcon    = new GUIContent(sunTex);
            _moonIcon   = new GUIContent(moonTex);
            _cloudsIcon = new GUIContent(cloudsTex);
        }
示例#3
0
        protected void OnEnable()
        {
            _guiContent          = new GUIContent();
            _skyParamsLabel      = new GUIContent("Sky Dot Params", "List of sky colors, based on time of day. Each list item contains “time” filed that should be specified in percents (0 - 100)");
            _starsParamsLabel    = new GUIContent("Stars Dot Params", "Allows you to manage stars tint color over time. Each list item contains “time” filed that should be specified in percents (0 - 100)");
            _sunParamsLabel      = new GUIContent("Sun Dot Params", "Sun appearance and light params depending on time of day. Each list item contains “time” filed that should be specified in percents (0 - 100)");
            _moonParamsLabel     = new GUIContent("Moon Dot Params", "Moon appearance and light params depending on time of day. Each list item contains “time” filed that should be specified in percents (0 - 100)");
            _framesIntervalLabel = new GUIContent("Frames Interval", "Reduce the skybox day-night cycle update to run every \"n\" frames");

            // Sky
            _skyDotParams = serializedObject.FindProperty("_skyParamsList").FindPropertyRelative("Params");
            // Stars
            _starsDotParams = serializedObject.FindProperty("_starsParamsList").FindPropertyRelative("Params");
            // Sun
            _sunrise      = serializedObject.FindProperty("_sunrise");
            _sunset       = serializedObject.FindProperty("_sunset");
            _sunAltitude  = serializedObject.FindProperty("_sunAltitude");
            _sunLongitude = serializedObject.FindProperty("_sunLongitude");
            _sunOrbit     = serializedObject.FindProperty("_sunOrbit");
            _sunDotParams = serializedObject.FindProperty("_sunParamsList").FindPropertyRelative("Params");
            // Moon
            _moonrise      = serializedObject.FindProperty("_moonrise");
            _moonset       = serializedObject.FindProperty("_moonset");
            _moonAltitude  = serializedObject.FindProperty("_moonAltitude");
            _moonLongitude = serializedObject.FindProperty("_moonLongitude");
            _moonOrbit     = serializedObject.FindProperty("_moonOrbit");
            _moonDotParams = serializedObject.FindProperty("_moonParamsList").FindPropertyRelative("Params");
            // General
            _framesInterval = serializedObject.FindProperty("_framesInterval");

            // Icons
            var skinFolder = (EditorGUIUtility.isProSkin) ? "Professional/" : "Personal/";

            var skyTex     = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Sky_16.png");
            var starsTex   = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Star_16.png");
            var sunTex     = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Sun_16.png");
            var moonTex    = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Moon_16.png");
            var generalTex = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Tag_16.png");

            _skyIcon     = new GUIContent(skyTex);
            _starsIcon   = new GUIContent(starsTex);
            _sunIcon     = new GUIContent(sunTex);
            _moonIcon    = new GUIContent(moonTex);
            _generalIcon = new GUIContent(generalTex);
        }
        //---------------------------------------------------------------------
        // Protected
        //---------------------------------------------------------------------

        protected void OnEnable()
        {
            // Skybox
            _skyboxMaterial = serializedObject.FindProperty("SkyboxMaterial");
            // Sky
            _skyTopColor       = serializedObject.FindProperty("_topColor");
            _skyMiddleColor    = serializedObject.FindProperty("_middleColor");
            _skyBottomColor    = serializedObject.FindProperty("_bottomColor");
            _skyTopExponent    = serializedObject.FindProperty("_topExponent");
            _skyBottomExponent = serializedObject.FindProperty("_bottomExponent");
            // Stars
            _starsEnabled        = serializedObject.FindProperty("_starsEnabled");
            _starsCubemap        = serializedObject.FindProperty("_starsCubemap");
            _starsTint           = serializedObject.FindProperty("_starsTint");
            _starsExtinction     = serializedObject.FindProperty("_starsExtinction");
            _starsTwinklingSpeed = serializedObject.FindProperty("_starsTwinklingSpeed");
            // Sun
            _sunEnabled         = serializedObject.FindProperty("_sunEnabled");
            _sunLight           = serializedObject.FindProperty("_sunLight");
            _sunTexture         = serializedObject.FindProperty("_sunTexture");
            _sunTint            = serializedObject.FindProperty("_sunTint");
            _sunSize            = serializedObject.FindProperty("_sunSize");
            _sunHalo            = serializedObject.FindProperty("_sunHalo");
            _sunFlare           = serializedObject.FindProperty("_sunFlare");
            _sunFlareBrightness = serializedObject.FindProperty("_sunFlareBrightness");
            // Moon
            _moonEnabled         = serializedObject.FindProperty("_moonEnabled");
            _moonTexture         = serializedObject.FindProperty("_moonTexture");
            _moonLight           = serializedObject.FindProperty("_moonLight");
            _moonTint            = serializedObject.FindProperty("_moonTint");
            _moonSize            = serializedObject.FindProperty("_moonSize");
            _moonHalo            = serializedObject.FindProperty("_moonHalo");
            _moonFlare           = serializedObject.FindProperty("_moonFlare");
            _moonFlareBrightness = serializedObject.FindProperty("_moonFlareBrightness");
            // Clouds
            _cloudsEnabled  = serializedObject.FindProperty("_cloudsEnabled");
            _cloudsCubemap  = serializedObject.FindProperty("_cloudsCubemap");
            _cloudsTint     = serializedObject.FindProperty("_cloudsTint");
            _cloudsHeight   = serializedObject.FindProperty("_cloudsHeight");
            _cloudsRotation = serializedObject.FindProperty("_cloudsRotation");
            // General
            _exposure       = serializedObject.FindProperty("_exposure");
            _adjustFogColor = serializedObject.FindProperty("_adjustFogColor");

            // Presets
            _presets = FarlandSkiesEditorUtility.LoadFromAsset <SkyboxControllerPresets>("Low Poly/Data/SkyboxControllerPresets.asset");

            // Labels
            _emptyGUIContent = new GUIContent(" ");

            // Icons
            var skinFolder = (EditorGUIUtility.isProSkin) ? "Professional/" : "Personal/";

            var starsTex   = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Star_16.png");
            var skyTex     = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Sky_16.png");
            var sunTex     = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Sun_16.png");
            var moonTex    = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Moon_16.png");
            var cloudsTex  = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Cloud_16.png");
            var generalTex = FarlandSkiesEditorUtility.LoadEditorIcon(skinFolder + "Tag_16.png");

            _starsIcon   = new GUIContent(starsTex);
            _skyIcon     = new GUIContent(skyTex);
            _sunIcon     = new GUIContent(sunTex);
            _moonIcon    = new GUIContent(moonTex);
            _cloudsIcon  = new GUIContent(cloudsTex);
            _generalIcon = new GUIContent(generalTex);
        }