コード例 #1
0
    public static bool ReleaseResNodeAsync(IResNodeHandle _handle, ResNode _resNode, IAsyncResLoadHandler callBack, bool _bImmediate)
    {
        bool result = false;

        if (_handle != null && _resNode != null)
        {
            if (m_dicResNodeHandle.ContainsKey(_handle))
            {
                List <ResNode> listValue = m_dicResNodeHandle[_handle];

                ResNode FindedResNode = null;

                foreach (ResNode tmpResNode in listValue)
                {
                    if (tmpResNode.instanceID == _resNode.instanceID)
                    {
                        FindedResNode = tmpResNode;
                        break;
                    }
                }

                if (FindedResNode != null)
                {
                    listValue.Remove(FindedResNode);
                    DeleteAssetsAsync(ref _resNode, callBack, _bImmediate);
                    result = true;
                }
            }
        }


        return(result);
    }
コード例 #2
0
 public static ResNode GetAssetsAsync(AssetType t, string assetBundleName, string assetName,
                                      IAsyncResLoadHandler callBack,
                                      System.Object userDataObj  = null,
                                      AssetLoadPriority priority = AssetLoadPriority.Priority_Normal)
 {
     return(GetAssetsAsync(t, assetBundleName, assetName, callBack.ResLoadCallBack, userDataObj, priority));
 }
コード例 #3
0
 public static ResNode GetAssetsAsync(AssetType t, ResConfigData conf,
                                      IAsyncResLoadHandler callBack,
                                      System.Object userDataObj  = null,
                                      AssetLoadPriority priority = AssetLoadPriority.Priority_Normal)
 {
     return(GetAssetsAsync(t, conf, callBack.ResLoadCallBack, userDataObj, priority));
 }
コード例 #4
0
    public static ResNode GetResNodeAsync(IResNodeHandle _handle, ResNodeHandleParamBase _param, IAsyncResLoadHandler callBack, System.Object userDataObj = null, AssetLoadPriority priority = AssetLoadPriority.Priority_Normal)
    {
        if (_handle == null || _param == null)
        {
            return(null);
        }

        ResNode returnNode = null;

        #region 分类型
        if (_param is ResNodeHandleParam_Path)
        {
            ResNodeHandleParam_Path pathParam = _param as ResNodeHandleParam_Path;

            returnNode = GetAssetsAsync(_param.AssetType, callBack, pathParam.StrResPath, pathParam.IsGuid, userDataObj, priority);
        }
        else if (_param is ResNodeHandleParam_Bundle)
        {
            ResNodeHandleParam_Bundle bundleParam = _param as ResNodeHandleParam_Bundle;

            returnNode = GetAssetsAsync(_param.AssetType, bundleParam.StrBundleName, bundleParam.StrAssetName, callBack, userDataObj, priority);
        }
        else if (_param is ResNodeHandleParam_ResConfigData)
        {
            ResNodeHandleParam_ResConfigData resConfigData = _param as ResNodeHandleParam_ResConfigData;

            returnNode = GetAssetsAsync(_param.AssetType, resConfigData.ConfigData, callBack, userDataObj, priority);
        }
        #endregion

        if (returnNode != null)
        {
            if (m_dicResNodeHandle.ContainsKey(_handle))
            {
                m_dicResNodeHandle[_handle].Add(returnNode);
            }
            else
            {
                m_dicResNodeHandle.Add(_handle, new List <ResNode>()
                {
                    returnNode
                });
            }
        }

        return(returnNode);
    }
コード例 #5
0
 public static void DeleteAssetsAsync(ref ResNode conf,
                                      IAsyncResLoadHandler callBack, bool Immediate)
 {
     DeleteAssetsAsync(ref conf, callBack.ResLoadCallBack, Immediate);
 }
コード例 #6
0
 public static ResNode GetAssetsAsync(AssetType t, IAsyncResLoadHandler callBack,
                                      string strParam, bool isGuid = false, System.Object userDataObj = null, AssetLoadPriority priority = AssetLoadPriority.Priority_Normal)
 {
     return(GetAssetsAsync(t, callBack.ResLoadCallBack, strParam, isGuid, userDataObj, priority));
 }