Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="assetParameter"></param>
 public virtual void LoadAsset(AssetParameter assetParameter, string loadType)
 {
     if (beginLoad)
     {
         throw new ArgumentException("Loading entity, can't add new resources!");
     }
     if (needs.Count == 0)
     {
         loaded = 0;
         toLoad = 0;
     }
     if (!assets.ContainsKey(assetParameter.Path) && !needs.ContainsKey(assetParameter.Path))
     {
         if (assetLoaders.ContainsKey(loadType))
         {
             assetLoaders[loadType].LoadAsset(assetParameter, loadType);
         }
         needs.Add(assetParameter.Path, assetParameter);
     }
     else
     {
         if (assets.ContainsKey(assetParameter.Path))
         {
             IAssetBundle assetBundle = assets[assetParameter.Path];
             if (assetBundle.Parameter.StorageType <= assetParameter.StorageType)
             {
                 assetBundle.Parameter = assetParameter;
             }
         }
     }
 }
Ejemplo n.º 2
0
    static int LoadAsset(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(com.gt.IAssetManager), typeof(com.gt.assets.AssetParameter)))
        {
            IAssetManager obj = LuaScriptMgr.GetNetObject <IAssetManager>(L, 1);
            com.gt.assets.AssetParameter arg0 = LuaScriptMgr.GetNetObject <com.gt.assets.AssetParameter>(L, 2);
            obj.LoadAsset(arg0);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(com.gt.IAssetManager), typeof(string)))
        {
            IAssetManager obj  = LuaScriptMgr.GetNetObject <IAssetManager>(L, 1);
            string        arg0 = LuaScriptMgr.GetString(L, 2);
            obj.LoadAsset(arg0);
            return(0);
        }
        else if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(com.gt.IAssetManager), typeof(com.gt.assets.AssetParameter), typeof(string)))
        {
            IAssetManager obj = LuaScriptMgr.GetNetObject <IAssetManager>(L, 1);
            com.gt.assets.AssetParameter arg0 = LuaScriptMgr.GetNetObject <com.gt.assets.AssetParameter>(L, 2);
            string arg1 = LuaScriptMgr.GetString(L, 3);
            obj.LoadAsset(arg0, arg1);
            return(0);
        }
        else if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(com.gt.IAssetManager), typeof(string), typeof(string)))
        {
            IAssetManager obj  = LuaScriptMgr.GetNetObject <IAssetManager>(L, 1);
            string        arg0 = LuaScriptMgr.GetString(L, 2);
            string        arg1 = LuaScriptMgr.GetString(L, 3);
            obj.LoadAsset(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: IAssetManager.LoadAsset");
        }

        return(0);
    }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="assetParameter"></param>
 public virtual void LoadAsset(AssetParameter assetParameter)
 {
     LoadAsset(assetParameter, null);
 }