Beispiel #1
0
    private ResourceRef DoLoadResource(string resourcePath, System.EventHandler<ResourceRef.ResEventArgs> evtListener, bool bAllowFail)
    {
        InternalResourceRef resRef = GetExistResourceRef(resourcePath);
        if (null != resRef)
        {
            resRef.AddRef();
            if (null != evtListener)
            {
                resRef.SetEventListener(evtListener);
            }
            return resRef;
        }

        resRef = new InternalResourceRef(resourcePath);
        resRef.AddRef();
        AddResourceRef(resRef);

        if (evtListener != null)
        {
            resRef.SetEventListener(evtListener);
        }

        string package_name = UnityTools.GetPackageName(resourcePath);

        StartCoroutine(LoadResourceCoroutineMulti(package_name, new RequestArg_Resource(resourcePath, resRef, bAllowFail)));
        return resRef;
    }
Beispiel #2
0
 public RequestArg_Resource(string _path, InternalResourceRef _resource_ref, bool _bAllowFail)
     : base(TRequestType.EResource)
 {
     path = _path;
     resource_ref = _resource_ref;
     bAllowFail = _bAllowFail;
 }
Beispiel #3
0
 private void AddResourceRef(InternalResourceRef resRef)
 {
     _ltResource.Add(resRef);
 }