Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="material"></param>
        /// <param name="sunDisk"></param>
        public static void SetSunDisk(Material material, SunDisk sunDisk)
        {
            SetInt(material, PropSunDisk, (int)sunDisk);

            switch (sunDisk)
            {
            case SunDisk.None:
                SetKeyword(material, KeySundiskNone, true);
                SetKeyword(material, KeySundiskSimple, false);
                SetKeyword(material, KeySundiskHighQuality, false);
                break;

            case SunDisk.Simple:
                SetKeyword(material, KeySundiskNone, false);
                SetKeyword(material, KeySundiskSimple, true);
                SetKeyword(material, KeySundiskHighQuality, false);
                break;

            case SunDisk.HighQuality:
                SetKeyword(material, KeySundiskNone, false);
                SetKeyword(material, KeySundiskSimple, false);
                SetKeyword(material, KeySundiskHighQuality, true);
                break;

            default:
                SetKeyword(material, KeySundiskNone, true);
                SetKeyword(material, KeySundiskSimple, false);
                SetKeyword(material, KeySundiskHighQuality, false);
                break;
            }
        }
Beispiel #2
0
        public override void Save()
        {
            Material mat = Graphics.Instance?.SkyboxManager?.Skybox;

            if (mat != null && mat.shader.name == shaderName)
            {
                sunDisk             = (ProceduralSkyboxSettings.SunDisk)mat.GetInt("_SunDisk");
                sunSize             = mat.GetFloat("_SunSize");
                sunsizeConvergence  = mat.GetFloat("_SunSizeConvergence");
                atmosphereThickness = mat.GetFloat("_AtmosphereThickness");
                skyTint             = mat.GetColor("_SkyTint");
                groundTint          = mat.GetColor("_GroundColor");
                exposure            = mat.GetFloat("_Exposure");
            }
        }