示例#1
0
        /// <summary>
        /// 异步加载
        /// </summary>
        public void Load(string resName, System.Action <Asset, EAssetResult> prepareCallbcak)
        {
            // 防止重复加载
            if (Result != EAssetResult.None)
            {
                LogSystem.Log(ELogType.Warning, $"Asset {ResName} is already load.");
                return;
            }

            if (_cacheLoader != null)
            {
                LogSystem.Log(ELogType.Warning, $"Asset  {ResName}  loader must null.");
                return;
            }

            ResName          = resName;
            Result           = EAssetResult.Loading;
            _prepareCallback = prepareCallbcak;
            _cacheLoader     = AssetSystem.LoadAssetFile(ResName, AssetType, OnAssetFileLoad);
        }
示例#2
0
        /// <summary>
        /// 异步加载
        /// </summary>
        public void Load(string resName, System.Action <Asset> userCallbcak)
        {
            // 防止重复加载
            if (Result != EAssetResult.None)
            {
                LogSystem.Log(ELogType.Warning, $"Asset {ResName} is already load.");
                return;
            }

            if (_cacheLoader != null)
            {
                LogSystem.Log(ELogType.Warning, $"Asset  {ResName}  loader must null.");
                return;
            }

            ResName       = resName;
            Result        = EAssetResult.Loading;
            _userCallback = userCallbcak;
            bool isStreamScene = this is AssetScene;

            _cacheLoader = AssetSystem.LoadAssetFile(ResName, isStreamScene, OnAssetFileLoad);
        }