summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/ShaderProps.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-03-10 14:07:40 +0800
committerchai <chaifix@163.com>2022-03-10 14:07:40 +0800
commit22891bf59032ba88262824255a706d652031384b (patch)
tree7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/ShaderProps.cs
parent8b04ea73e540067f83870b61d89db4868fea5e8a (diff)
* move folder
Diffstat (limited to 'Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/ShaderProps.cs')
-rw-r--r--Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/ShaderProps.cs67
1 files changed, 0 insertions, 67 deletions
diff --git a/Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/ShaderProps.cs b/Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/ShaderProps.cs
deleted file mode 100644
index 36d9a825..00000000
--- a/Assets/ThirdParty/VRM/VRMShaders/ShaderProperty/Runtime/ShaderProps.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-#if UNITY_EDITOR
-using System;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-#endif
-
-
-namespace UniGLTF.ShaderPropExporter
-{
- public enum ShaderPropertyType
- {
- TexEnv,
- Color,
- Range,
- Float,
- Vector,
- }
-
- public struct ShaderProperty
- {
- public string Key;
- public ShaderPropertyType ShaderPropertyType;
-
- public ShaderProperty(string key, ShaderPropertyType propType)
- {
- Key = key;
- ShaderPropertyType = propType;
- }
- }
-
- public class ShaderProps
- {
- public ShaderProperty[] Properties;
-
-#if UNITY_EDITOR
- static ShaderPropertyType ConvType(ShaderUtil.ShaderPropertyType src)
- {
- switch (src)
- {
- case ShaderUtil.ShaderPropertyType.TexEnv: return ShaderPropertyType.TexEnv;
- case ShaderUtil.ShaderPropertyType.Color: return ShaderPropertyType.Color;
- case ShaderUtil.ShaderPropertyType.Float: return ShaderPropertyType.Float;
- case ShaderUtil.ShaderPropertyType.Range: return ShaderPropertyType.Range;
- case ShaderUtil.ShaderPropertyType.Vector: return ShaderPropertyType.Vector;
- default: throw new NotImplementedException();
- }
- }
-
- public static ShaderProps FromShader(Shader shader)
- {
- var properties = new List<ShaderProperty>();
- for (int i = 0; i < ShaderUtil.GetPropertyCount(shader); ++i)
- {
- var name = ShaderUtil.GetPropertyName(shader, i);
- var propType = ShaderUtil.GetPropertyType(shader, i);
- properties.Add(new ShaderProperty(name, ConvType(propType)));
- }
-
- return new ShaderProps
- {
- Properties = properties.ToArray(),
- };
- }
-#endif
- }
-}