Example #1
0
        public override void Initial(UnityEngine.Camera cam, UnityEngine.Material mat)
        {
            base.Initial(cam, mat);
            mat.enableInstancing = true;

            columnCount = UnityEngine.Mathf.FloorToInt(mat.GetFloat("_Column"));
            rowCount    = UnityEngine.Mathf.FloorToInt(mat.GetFloat("_Row"));
        }
        public static float GetFloat(this UnityEngine.Material source, string key, float defalutValue)
        {
            if (source.HasProperty(key))
            {
                return(source.GetFloat(key));
            }

            return(defalutValue);
        }
Example #3
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.GetFloat(this.property_id);
        }
Example #4
0
        static StackObject *GetFloat_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @name = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Material instance_of_this_method = (UnityEngine.Material) typeof(UnityEngine.Material).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.GetFloat(@name);

            __ret->ObjectType       = ObjectTypes.Float;
            *(float *)&__ret->Value = result_of_this_method;
            return(__ret + 1);
        }
Example #5
0
 public override float GetFloat(string propertyName)
 {
     return(material.GetFloat(propertyName));
 }