private static void FixRenderingPath()
        {
            if (renderingPath != RenderingPath.DeferredShading)
            {
                Object playerSettings = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/ProjectSettings.asset").FirstOrDefault();
                if (playerSettings)
                {
                    Undo.RecordObject(playerSettings, "Change Project Settings");
                }
                renderingPath = RenderingPath.DeferredShading;
            }

            BuiltinShaderMode currentShadingShaderMode     = GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredShading);
            BuiltinShaderMode currentReflectionsShaderMode = GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredReflections);

            bool needsShaderUpdate = deferredShadingShader != neoFurDeferredShadingShader || deferredReflectionsShader != deferredReflectionsShader;

            needsShaderUpdate |= currentShadingShaderMode != BuiltinShaderMode.UseCustom || currentReflectionsShaderMode != BuiltinShaderMode.UseCustom;
            if (needsShaderUpdate)
            {
                string warningMessage = "";

                if (currentShadingShaderMode == BuiltinShaderMode.UseCustom && deferredShadingShader && deferredShadingShader != neoFurDeferredShadingShader)
                {
                    warningMessage += "Deferred shading shader is currently set to " + deferredShadingShader.name + ". It will be changed to a neofur deferred shading shader.\n";
                }
                if (currentReflectionsShaderMode == BuiltinShaderMode.UseCustom && deferredReflectionsShader && deferredReflectionsShader != neoFurDeferredReflectionsShader)
                {
                    warningMessage += "Deferred reflections shader is currently set to " + deferredReflectionsShader.name + ". It will be changed to a neofur deferred reflections shader.\n";
                }

                if (warningMessage != "")
                {
                    warningMessage += "Do you want to change shader references listed above?";
                    if (!EditorUtility.DisplayDialog("Deferred rendering shader conflict.", warningMessage, "Yes", "No"))
                    {
                        return;
                    }
                }

                Object graphicsSettings = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/GraphicsSettings.asset").FirstOrDefault();
                if (graphicsSettings)
                {
                    Undo.RecordObject(graphicsSettings, "Change Project Settings");
                }

                deferredShadingShader     = neoFurDeferredShadingShader;
                deferredReflectionsShader = neoFurDeferredReflectionsShader;
            }
        }
Esempio n. 2
0
    public static int GetShaderMode_s(IntPtr l)
    {
        int result;

        try
        {
            BuiltinShaderType type;
            LuaObject.checkEnum <BuiltinShaderType>(l, 1, out type);
            BuiltinShaderMode shaderMode = GraphicsSettings.GetShaderMode(type);
            LuaObject.pushValue(l, true);
            LuaObject.pushEnum(l, (int)shaderMode);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
 public static extern void SetShaderMode(BuiltinShaderType type, BuiltinShaderMode mode);
 public static extern void SetShaderMode(BuiltinShaderType type, BuiltinShaderMode mode);
 [NativeName("SetShaderModeScript")]   extern static public void                 SetShaderMode(BuiltinShaderType type, BuiltinShaderMode mode);