Пример #1
0
 public float[] GetFloatArray(
     int propertyId)
 {
     if (instancedProperties.Contains(propertyId))
     {
         return(materialPropertyBlock.GetFloatArray(propertyId));
     }
     else
     {
         return(material.GetFloatArray(propertyId));
     }
 }
    public static int GetFloatArray(IntPtr l)
    {
        int result;

        try
        {
            int total = LuaDLL.lua_gettop(l);
            if (LuaObject.matchType(l, total, 2, typeof(int)))
            {
                MaterialPropertyBlock materialPropertyBlock = (MaterialPropertyBlock)LuaObject.checkSelf(l);
                int nameID;
                LuaObject.checkType(l, 2, out nameID);
                float[] floatArray = materialPropertyBlock.GetFloatArray(nameID);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, floatArray);
                result = 2;
            }
            else if (LuaObject.matchType(l, total, 2, typeof(string)))
            {
                MaterialPropertyBlock materialPropertyBlock2 = (MaterialPropertyBlock)LuaObject.checkSelf(l);
                string name;
                LuaObject.checkType(l, 2, out name);
                float[] floatArray2 = materialPropertyBlock2.GetFloatArray(name);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, floatArray2);
                result = 2;
            }
            else if (LuaObject.matchType(l, total, 2, typeof(string), typeof(List <float>)))
            {
                MaterialPropertyBlock materialPropertyBlock3 = (MaterialPropertyBlock)LuaObject.checkSelf(l);
                string name2;
                LuaObject.checkType(l, 2, out name2);
                List <float> values;
                LuaObject.checkType <List <float> >(l, 3, out values);
                materialPropertyBlock3.GetFloatArray(name2, values);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (LuaObject.matchType(l, total, 2, typeof(int), typeof(List <float>)))
            {
                MaterialPropertyBlock materialPropertyBlock4 = (MaterialPropertyBlock)LuaObject.checkSelf(l);
                int nameID2;
                LuaObject.checkType(l, 2, out nameID2);
                List <float> values2;
                LuaObject.checkType <List <float> >(l, 3, out values2);
                materialPropertyBlock4.GetFloatArray(nameID2, values2);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function GetFloatArray to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }