public static UnityEngine.Texture GetTexture(this UnityEngine.Material source, string key, UnityEngine.Texture defalutValue)
        {
            if (source.HasProperty(key))
            {
                return(source.GetTexture(key));
            }

            return(defalutValue);
        }
Beispiel #2
0
        /** 初期化。
         */
        public void Initialize(UnityEngine.Material a_material_raw, string a_property_name)
        {
            Tool.Assert(a_material_raw != null);

            //material_raw
            this.material_raw = a_material_raw;

            //property_id
            this.property_id = UnityEngine.Shader.PropertyToID(a_property_name);

            //cache_value
            this.cache_value = a_material_raw.GetTexture(this.property_id);
        }
Beispiel #3
0
 public override Texture GetTexture(string propertyName)
 {
     return(new UnityTexture((UnityEngine.Texture2D)material.GetTexture(propertyName)));
 }