diff options
author | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
commit | 22891bf59032ba88262824255a706d652031384b (patch) | |
tree | 7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/PreShaderPropExporter.cs | |
parent | 8b04ea73e540067f83870b61d89db4868fea5e8a (diff) |
* move folder
Diffstat (limited to 'Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/PreShaderPropExporter.cs')
-rw-r--r-- | Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/PreShaderPropExporter.cs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/PreShaderPropExporter.cs b/Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/PreShaderPropExporter.cs deleted file mode 100644 index bdc6b49d..00000000 --- a/Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/PreShaderPropExporter.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using UnityEngine; -#if UNITY_EDITOR -using UnityEditor; -#endif - - -namespace UniGLTF.ShaderPropExporter -{ - public class PreExportShadersAttribute : Attribute { } - public class PreExportShaderAttribute : Attribute { } - - public struct SupportedShader - { - public string TargetFolder; - public string ShaderName; - - public SupportedShader(string targetFolder, string shaderName) - { - TargetFolder = targetFolder; - ShaderName = shaderName; - } - } - - public static partial class PreShaderPropExporter - { - static Dictionary<string, ShaderProps> m_shaderPropMap; - - public static ShaderProps GetPropsForSupportedShader(string shaderName) - { - if (m_shaderPropMap == null) - { - m_shaderPropMap = new Dictionary<string, ShaderProps>(); - foreach (var prop in typeof(PreShaderPropExporter).GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) - { - if (prop.GetCustomAttributes(typeof(PreExportShaderAttribute), true).Any()) - { - var kv = (KeyValuePair<string, ShaderProps>)prop.GetValue(null, null); - m_shaderPropMap.Add(kv.Key, kv.Value); - } - } - } - - ShaderProps props; - if (m_shaderPropMap.TryGetValue(shaderName, out props)) - { - return props; - } - -#if UNITY_EDITOR - // fallback - Debug.LogWarningFormat("{0} is not predefined shader. Use ShaderUtil", shaderName); - var shader = Shader.Find(shaderName); - return ShaderProps.FromShader(shader); -#else - return null; -#endif - } - } -} |