示例#1
0
    public static ResNode GetResNode(IResNodeHandle _handle, ResNodeHandleParamBase _param)
    {
        if (_handle == null || _param == null)
        {
            return(null);
        }

        ResNode returnNode = null;

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

            returnNode = GetAssets(_param.AssetType, pathParam.StrResPath);
        }
        else if (_param is ResNodeHandleParam_Bundle)
        {
            ResNodeHandleParam_Bundle bundleParam = _param as ResNodeHandleParam_Bundle;


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

            returnNode = GetAssets(_param.AssetType, resConfigData.ConfigData);
        }
        #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);
    }
示例#2
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);
    }