-
Notifications
You must be signed in to change notification settings - Fork 78
/
GameLauncher.cs
71 lines (62 loc) · 2.42 KB
/
GameLauncher.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System.Collections;
using F8Framework.Core;
using F8Framework.F8ExcelDataClass;
using UnityEngine;
namespace F8Framework.Launcher
{
public class GameLauncher : MonoBehaviour
{
IEnumerator Start()
{
// 初始化模块中心
ModuleCenter.Initialize(this);
// 初始化版本
FF8.HotUpdate = ModuleCenter.CreateModule<HotUpdateManager>();
// 按顺序创建模块,可按需添加
FF8.Message = ModuleCenter.CreateModule<MessageManager>();
FF8.Input = ModuleCenter.CreateModule<InputManager>(new DefaultInputHelper());
FF8.Storage = ModuleCenter.CreateModule<StorageManager>();
FF8.Timer = ModuleCenter.CreateModule<TimerManager>();
FF8.Procedure = ModuleCenter.CreateModule<ProcedureManager>();
FF8.Network = ModuleCenter.CreateModule<NetworkManager>();
FF8.FSM = ModuleCenter.CreateModule<FSMManager>();
FF8.GameObjectPool = ModuleCenter.CreateModule<GameObjectPool>();
FF8.Asset = ModuleCenter.CreateModule<AssetManager>();
#if UNITY_WEBGL
yield return AssetBundleManager.Instance.LoadAssetBundleManifest(); // WebGL专用,如果游戏中没有使用任何AB包加载资源,可以删除此方法的调用!
#endif
FF8.Config = ModuleCenter.CreateModule<F8DataManager>();
FF8.Audio = ModuleCenter.CreateModule<AudioManager>();
FF8.Tween = ModuleCenter.CreateModule<Tween>();
FF8.UI = ModuleCenter.CreateModule<UIManager>();
#if UNITY_WEBGL
yield return F8DataManager.Instance.LoadLocalizedStringsIEnumerator(); // WebGL专用
#endif
FF8.Local = ModuleCenter.CreateModule<Localization>();
FF8.SDK = ModuleCenter.CreateModule<SDKManager>();
FF8.Download = ModuleCenter.CreateModule<DownloadManager>();
FF8.LogWriter = ModuleCenter.CreateModule<F8LogWriter>();
StartGame();
yield break;
}
// 开始游戏
public void StartGame()
{
}
void Update()
{
// 更新模块
ModuleCenter.Update();
}
void LateUpdate()
{
// 更新模块
ModuleCenter.LateUpdate();
}
void FixedUpdate()
{
// 更新模块
ModuleCenter.FixedUpdate();
}
}
}