コード例 #1
0
 public Matrix4x4[] GetMatrixArray(
     int propertyId)
 {
     if (instancedProperties.Contains(propertyId))
     {
         return(materialPropertyBlock.GetMatrixArray(propertyId));
     }
     else
     {
         return(material.GetMatrixArray(propertyId));
     }
 }
コード例 #2
0
    public static int GetMatrixArray(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);
                Matrix4x4[] matrixArray = materialPropertyBlock.GetMatrixArray(nameID);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, matrixArray);
                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);
                Matrix4x4[] matrixArray2 = materialPropertyBlock2.GetMatrixArray(name);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, matrixArray2);
                result = 2;
            }
            else if (LuaObject.matchType(l, total, 2, typeof(string), typeof(List <Matrix4x4>)))
            {
                MaterialPropertyBlock materialPropertyBlock3 = (MaterialPropertyBlock)LuaObject.checkSelf(l);
                string name2;
                LuaObject.checkType(l, 2, out name2);
                List <Matrix4x4> values;
                LuaObject.checkType <List <Matrix4x4> >(l, 3, out values);
                materialPropertyBlock3.GetMatrixArray(name2, values);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (LuaObject.matchType(l, total, 2, typeof(int), typeof(List <Matrix4x4>)))
            {
                MaterialPropertyBlock materialPropertyBlock4 = (MaterialPropertyBlock)LuaObject.checkSelf(l);
                int nameID2;
                LuaObject.checkType(l, 2, out nameID2);
                List <Matrix4x4> values2;
                LuaObject.checkType <List <Matrix4x4> >(l, 3, out values2);
                materialPropertyBlock4.GetMatrixArray(nameID2, values2);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function GetMatrixArray to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }