コード例 #1
0
        /// <summary>
        /// LoadAsset
        /// </summary>
        /// <param name="req"></param>
        /// <param name="coroutine"></param>
        /// <returns></returns>
        static public AssetBundleLoadAssetOperation LoadAsset(CRequest req, bool coroutine = false)
        {
            AssetBundleLoadAssetOperation op = null;
            var groupQueue = BundleGroundQueue.Get();

            groupQueue.priority = req.priority;
            groupQueue.Enqueue(req);
            if (coroutine)
            {
#if UNITY_EDITOR
                if (ManifestManager.SimulateAssetBundleInEditor)
                {
                    op = new AssetBundleLoadAssetOperationSimulation();
                }
                else
                {
                    op = new AssetBundleLoadAssetOperationFull();
                }
#else
                op = new AssetBundleLoadAssetOperationFull();
#endif
                op.SetRequest(req);
                req.assetOperation = op;
            }
            LoadGroupAsset(groupQueue);
            return(op);
        }
コード例 #2
0
        /// <summary>
        /// LoadAsset
        /// </summary>
        /// <param name="req"></param>
        /// <param name="coroutine"></param>
        /// <returns></returns>
        static public AssetBundleLoadAssetOperation LoadAsset(CRequest req, bool coroutine = false)
        {
            AssetBundleLoadAssetOperation op = null;

            if (coroutine)
            {
#if UNITY_EDITOR
                if (ManifestManager.SimulateAssetBundleInEditor)
                {
                    op = new AssetBundleLoadAssetOperationSimulation();
                }
                else
                {
                    op = new AssetBundleLoadAssetOperationFull();
                }
#else
                op = new AssetBundleLoadAssetOperationFull();
#endif
                op.SetRequest(req);
                req.assetOperation = op;
                op.Update();
            }

            var groupQueue = BundleGroundQueue.Get();
            groupQueue.priority = req.priority;
            groupQueue.Enqueue(req);
#if HUGULA_LOADER_DEBUG
            HugulaDebug.FilterLogFormat(req.key, "<color=#15A0A1>0.0.1  before LoadGroupAsset, ResourcesLoader.LoadAsset(Request(url={0},assetname={1},keyhash={2}),coroutine={3}),assetOperation={4},frameCount={5}</color>", req.url, req.assetName, req.keyHashCode, coroutine, op, Time.frameCount);
#endif

            LoadGroupAsset(groupQueue);
            return(op);
        }