update yooasset2.0
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Event;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
public class Boot : MonoBehaviour
|
||||
@@ -15,23 +17,33 @@ public class Boot : MonoBehaviour
|
||||
Debug.Log($"资源系统运行模式:{PlayMode}");
|
||||
Application.targetFrameRate = 60;
|
||||
Application.runInBackground = true;
|
||||
DontDestroyOnLoad(this.gameObject);
|
||||
}
|
||||
void Start()
|
||||
IEnumerator Start()
|
||||
{
|
||||
// 游戏管理器
|
||||
GameManager.Instance.Behaviour = this;
|
||||
|
||||
// 初始化事件系统
|
||||
UniEvent.Initalize();
|
||||
|
||||
// 初始化单例系统
|
||||
UniSingleton.Initialize();
|
||||
|
||||
// 初始化资源系统
|
||||
YooAssets.Initialize();
|
||||
YooAssets.SetOperationSystemMaxTimeSlice(30);
|
||||
|
||||
// 创建补丁管理器
|
||||
UniSingleton.CreateSingleton<PatchManager>();
|
||||
// 加载更新页面
|
||||
var go = Resources.Load<GameObject>("PatchWindow");
|
||||
GameObject.Instantiate(go);
|
||||
|
||||
// 开始补丁更新流程
|
||||
PatchManager.Instance.Run(PlayMode);
|
||||
PatchOperation operation = new PatchOperation("DefaultPackage", DefaultBuildPipeline.BuiltinBuildPipelineName, PlayMode);
|
||||
YooAssets.StartOperation(operation);
|
||||
yield return operation;
|
||||
|
||||
// 设置默认的资源包
|
||||
var gamePackage = YooAssets.GetPackage("DefaultPackage");
|
||||
YooAssets.SetDefaultPackage(gamePackage);
|
||||
|
||||
// 切换到主页面场景
|
||||
SceneEventDefine.ChangeToHomeScene.SendEventMessage();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user