Beispiel #1
0
    /// <summary>
    /// 处理AssetResMsg消息
    /// </summary>
    /// <param name="assetResMsg"></param>
    private void ProcessAssetResMsg(AssetResMsg assetResMsg)
    {
        switch ((AssetEvent)assetResMsg.msgId)
        {
        case AssetEvent.GetRes:
            GetResources(assetResMsg.SceneName, assetResMsg.BundleName, assetResMsg.ResName, assetResMsg.IsSingle, assetResMsg.BackMsgId);
            break;

        case AssetEvent.ReleaseSingleObj:
            ILoaderManager.Instance.DisposeResObj(assetResMsg.SceneName, assetResMsg.BundleName, assetResMsg.ResName);
            break;

        case AssetEvent.ReleaseBundleObjs:
            ILoaderManager.Instance.DisposeBundleRes(assetResMsg.SceneName, assetResMsg.BundleName);
            break;

        case AssetEvent.ReleaseSceneObj:
            ILoaderManager.Instance.DisposeAllResObjs(assetResMsg.SceneName);
            break;

        case AssetEvent.ReleaseSingleBundle:
            ILoaderManager.Instance.DisposeAssetBundle(assetResMsg.SceneName, assetResMsg.BundleName);
            break;

        case AssetEvent.ReleaseSceneBundle:
            ILoaderManager.Instance.DisposeAllAssetBundle(assetResMsg.SceneName);
            break;

        case AssetEvent.ReleaseAll:
            ILoaderManager.Instance.DisposeAllAssetBundleAndRes(assetResMsg.SceneName);
            break;

        default:
            break;
        }
    }
Beispiel #2
0
    private void Start()
    {
        MsgBase msg = new AssetResMsg(true, (ushort)AssetEvent.GetRes, "scene1", "GameObject", "Cube.prefab", (ushort)AssetEvent.InitObj);

        ProcessEvent(msg);
    }