Ejemplo n.º 1
0
    public XAssetLoader(string path, string assetName = null, CResourceManager.ASyncLoadABAssetDelegate callback = null, params object[] args)
    {
        object[] newArgs = new object[2];
        newArgs[0] = assetName;
        newArgs[1] = args;

        Callback     = callback;
        CallbackArgs = args;

        new CAssetFileBridge(path, assetName, OnAssetLoaded, newArgs);
    }
Ejemplo n.º 2
0
    public CAssetLoader(string path, string assetName = null, CResourceManager.ASyncLoadABAssetDelegate callback = null, params object[] args)
    {
        object[] newArgs = new object[2];
        newArgs[0] = assetName;
        newArgs[1] = args;

        Callback = callback;
        CallbackArgs = args;

        new CAssetFileBridge(path, assetName, OnAssetLoaded, newArgs);
    }
Ejemplo n.º 3
0
    public CStaticAssetLoader(string path, CResourceManager.ASyncLoadABAssetDelegate callback = null, params object[] args)
    {
        if (string.IsNullOrEmpty(path))
        {
            CBase.LogError("XStaticAssetLoader 空资源路径!");
        }

        new CAssetFileBridge(path, (_obj, _args) =>
        {
            Object asset = null;
            if (!CachcedAssets.TryGetValue(path, out asset))
            {
                asset = Object.Instantiate(_obj);
                CachcedAssets[path] = asset;
            }

            if (callback != null)
            {
                callback(asset, args);
            }

            OnLoad(path, asset);
        });
    }