22using System ;
33using System . Collections . Generic ;
44using System . Linq ;
5- using LWGUI . Timeline ;
65using UnityEngine ;
76using UnityEditor ;
87using Object = UnityEngine . Object ;
@@ -19,6 +18,7 @@ public enum PropertyType
1918 Float ,
2019 Range ,
2120 Texture ,
21+ Integer ,
2222 }
2323
2424 [ Serializable ]
@@ -32,6 +32,7 @@ public PropertyValue(MaterialProperty prop)
3232 public string propertyName ;
3333 public PropertyType propertyType ;
3434 public float floatValue ;
35+ public int intValue ;
3536 public Color colorValue ;
3637 public Vector4 vectorValue ;
3738 public Texture textureValue ;
@@ -72,6 +73,9 @@ public void Apply(Material material, bool isDefaultMaterial, PerMaterialData per
7273 case PropertyType . Range :
7374 material . SetFloat ( propertyNameID , floatValue ) ;
7475 break ;
76+ case PropertyType . Integer :
77+ material . SetInteger ( propertyNameID , intValue ) ;
78+ break ;
7579 case PropertyType . Texture :
7680 material . SetTexture ( propertyNameID , textureValue ) ;
7781 break ;
@@ -96,6 +100,9 @@ public void Apply(Material material, bool isDefaultMaterial, PerMaterialData per
96100 case PropertyType . Range :
97101 prop . floatValue = floatValue ;
98102 break ;
103+ case PropertyType . Integer :
104+ prop . intValue = intValue ;
105+ break ;
99106 case PropertyType . Texture :
100107 prop . textureValue = textureValue ;
101108 break ;
@@ -118,11 +125,14 @@ public void CopyFromMaterialProperty(MaterialProperty prop)
118125 propertyType = PropertyType . Vector ;
119126 vectorValue = prop . vectorValue ;
120127 break ;
121- case MaterialProperty . PropType . Int :
122128 case MaterialProperty . PropType . Float :
123129 propertyType = PropertyType . Float ;
124130 floatValue = prop . floatValue ;
125131 break ;
132+ case MaterialProperty . PropType . Int :
133+ propertyType = PropertyType . Integer ;
134+ intValue = prop . intValue ;
135+ break ;
126136 case MaterialProperty . PropType . Range :
127137 propertyType = PropertyType . Range ;
128138 floatValue = prop . floatValue ;
0 commit comments