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