GetFloat() private method

private GetFloat ( int nameID ) : float
nameID int
return float
 static public int GetFloat(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(int)))
         {
             UnityEngine.MaterialPropertyBlock self = (UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             var ret = self.GetFloat(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(string)))
         {
             UnityEngine.MaterialPropertyBlock self = (UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.String a1;
             checkType(l, 2, out a1);
             var ret = self.GetFloat(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #2
0
    static int GetFloat(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <int>(L, 2))
            {
                UnityEngine.MaterialPropertyBlock obj = (UnityEngine.MaterialPropertyBlock)ToLua.CheckObject(L, 1, typeof(UnityEngine.MaterialPropertyBlock));
                int   arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                float o    = obj.GetFloat(arg0);
                LuaDLL.lua_pushnumber(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string>(L, 2))
            {
                UnityEngine.MaterialPropertyBlock obj = (UnityEngine.MaterialPropertyBlock)ToLua.CheckObject(L, 1, typeof(UnityEngine.MaterialPropertyBlock));
                string arg0 = ToLua.ToString(L, 2);
                float  o    = obj.GetFloat(arg0);
                LuaDLL.lua_pushnumber(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.MaterialPropertyBlock.GetFloat"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int GetFloat(IntPtr l)
 {
     try{
         if (matchType(l, 2, typeof(System.String)))
         {
             UnityEngine.MaterialPropertyBlock self = (UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.String a1;
             checkType(l, 2, out a1);
             System.Single ret = self.GetFloat(a1);
             pushValue(l, ret);
             return(1);
         }
         else if (matchType(l, 2, typeof(System.Int32)))
         {
             UnityEngine.MaterialPropertyBlock self = (UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Single ret = self.GetFloat(a1);
             pushValue(l, ret);
             return(1);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Beispiel #4
0
        /// <summary>
        /// Returns the instanced float value using MaterialBlocks.
        /// </summary>
        /// <param name="renderer"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static float GetFloatInstanced(this Renderer renderer, string name)
        {
            MaterialPropertyBlock mBlock = new MaterialPropertyBlock();

            renderer.GetPropertyBlock(mBlock);
            return(mBlock.GetFloat(name));
        }
Beispiel #5
0
 static public int GetFloat(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(int)))
         {
             UnityEngine.MaterialPropertyBlock self = (UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             var ret = self.GetFloat(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(string)))
         {
             UnityEngine.MaterialPropertyBlock self = (UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.String a1;
             checkType(l, 2, out a1);
             var ret = self.GetFloat(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function GetFloat to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 static public int GetFloat__Int32(IntPtr l)
 {
     try {
         UnityEngine.MaterialPropertyBlock self = (UnityEngine.MaterialPropertyBlock)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         var ret = self.GetFloat(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }