Browse Source

预加载自定义shader

guodong 2 years ago
parent
commit
a3c73e9c00

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -11,6 +11,8 @@ namespace GFGGame
 
         public static void Start()
         {
+            GFGAsset.Load<Shader>(ResPathUtil.GetShaderPath("Effect_distortion_add"));
+            GFGAsset.Load<Shader>(ResPathUtil.GetShaderPath("Effect_distortion_blend"));
             //界面
             ViewManager.Init();
             //日志

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Utils/ResPathUtil.cs

@@ -143,5 +143,9 @@ namespace GFGGame
             if (string.IsNullOrEmpty(res)) return "";
             return $"{TEXTURE_DIR_PATH}/Head/HeadBorder/{res}.{extName}";
         }
+        public static string GetShaderPath(string res)
+        {
+            return $"{Shader_DIR_PATH}/{res}.shader";
+        }
     }
 }