update space shooter
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UniFramework.Event;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
public class Boot : MonoBehaviour
|
||||
@@ -21,15 +21,15 @@ public class Boot : MonoBehaviour
|
||||
// 初始化事件系统
|
||||
UniEvent.Initalize();
|
||||
|
||||
// 初始化管理系统
|
||||
UniModule.Initialize();
|
||||
// 初始化单例系统
|
||||
UniSingleton.Initialize();
|
||||
|
||||
// 初始化资源系统
|
||||
YooAssets.Initialize();
|
||||
YooAssets.SetOperationSystemMaxTimeSlice(30);
|
||||
|
||||
// 创建补丁管理器
|
||||
UniModule.CreateModule<PatchManager>();
|
||||
UniSingleton.CreateSingleton<PatchManager>();
|
||||
|
||||
// 开始补丁更新流程
|
||||
PatchManager.Instance.Run(PlayMode);
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
using UniFramework.Pooling;
|
||||
using UniFramework.Window;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
internal class FsmInitGame : IStateNode
|
||||
@@ -17,7 +17,7 @@ internal class FsmInitGame : IStateNode
|
||||
}
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
UniModule.StartCoroutine(Prepare());
|
||||
UniSingleton.StartCoroutine(Prepare());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
using UniFramework.Window;
|
||||
using UniFramework.Event;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
internal class FsmSceneBattle : IStateNode
|
||||
@@ -17,7 +17,7 @@ internal class FsmSceneBattle : IStateNode
|
||||
}
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
UniModule.StartCoroutine(Prepare());
|
||||
UniSingleton.StartCoroutine(Prepare());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Window;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
internal class FsmSceneHome : IStateNode
|
||||
@@ -16,7 +16,7 @@ internal class FsmSceneHome : IStateNode
|
||||
}
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
UniModule.StartCoroutine(Prepare());
|
||||
UniSingleton.StartCoroutine(Prepare());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
@@ -3,22 +3,22 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Event;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
|
||||
public class GameManager : ModuleSingleton<GameManager>, IModule
|
||||
public class GameManager : SingletonInstance<GameManager>, ISingleton
|
||||
{
|
||||
private bool _isRun = false;
|
||||
private EventGroup _eventGroup = new EventGroup();
|
||||
private StateMachine _machine;
|
||||
|
||||
void IModule.OnCreate(object createParam)
|
||||
void ISingleton.OnCreate(object createParam)
|
||||
{
|
||||
}
|
||||
void IModule.OnDestroy()
|
||||
void ISingleton.OnDestroy()
|
||||
{
|
||||
_eventGroup.RemoveAllListener();
|
||||
}
|
||||
void IModule.OnUpdate()
|
||||
void ISingleton.OnUpdate()
|
||||
{
|
||||
if (_machine != null)
|
||||
_machine.Update();
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
/// <summary>
|
||||
@@ -19,7 +19,7 @@ public class FsmCreateDownloader : IStateNode
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
PatchEventDefine.PatchStatesChange.SendEventMessage("创建补丁下载器!");
|
||||
UniModule.StartCoroutine(CreateDownloader());
|
||||
UniSingleton.StartCoroutine(CreateDownloader());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
/// <summary>
|
||||
@@ -18,7 +18,7 @@ public class FsmDownloadFiles : IStateNode
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
PatchEventDefine.PatchStatesChange.SendEventMessage("开始下载补丁文件!");
|
||||
UniModule.StartCoroutine(BeginDownload());
|
||||
UniSingleton.StartCoroutine(BeginDownload());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
/// <summary>
|
||||
@@ -21,7 +21,7 @@ internal class FsmInitialize : IStateNode
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
PatchEventDefine.PatchStatesChange.SendEventMessage("初始化资源包!");
|
||||
UniModule.StartCoroutine(InitPackage());
|
||||
UniSingleton.StartCoroutine(InitPackage());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
|
||||
/// <summary>
|
||||
/// 流程更新完毕
|
||||
@@ -17,7 +17,7 @@ internal class FsmPatchDone : IStateNode
|
||||
PatchEventDefine.PatchStatesChange.SendEventMessage("开始游戏!");
|
||||
|
||||
// 创建游戏管理器
|
||||
UniModule.CreateModule<GameManager>();
|
||||
UniSingleton.CreateSingleton<GameManager>();
|
||||
|
||||
// 开启游戏流程
|
||||
GameManager.Instance.Run();
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
|
||||
/// <summary>
|
||||
/// 流程准备工作
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
/// <summary>
|
||||
@@ -19,7 +19,7 @@ public class FsmUpdateManifest : IStateNode
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
PatchEventDefine.PatchStatesChange.SendEventMessage("更新资源清单!");
|
||||
UniModule.StartCoroutine(UpdateManifest());
|
||||
UniSingleton.StartCoroutine(UpdateManifest());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
/// <summary>
|
||||
@@ -19,7 +19,7 @@ internal class FsmUpdateVersion : IStateNode
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
PatchEventDefine.PatchStatesChange.SendEventMessage("获取最新的资源版本 !");
|
||||
UniModule.StartCoroutine(GetStaticVersion());
|
||||
UniSingleton.StartCoroutine(GetStaticVersion());
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
|
||||
+5
-5
@@ -4,10 +4,10 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using UniFramework.Event;
|
||||
using UniFramework.Module;
|
||||
using UniFramework.Singleton;
|
||||
using YooAsset;
|
||||
|
||||
public class PatchManager : ModuleSingleton<PatchManager>, IModule
|
||||
public class PatchManager : SingletonInstance<PatchManager>, ISingleton
|
||||
{
|
||||
/// <summary>
|
||||
/// 运行模式
|
||||
@@ -29,14 +29,14 @@ public class PatchManager : ModuleSingleton<PatchManager>, IModule
|
||||
private EventGroup _eventGroup = new EventGroup();
|
||||
private StateMachine _machine;
|
||||
|
||||
void IModule.OnCreate(object createParam)
|
||||
void ISingleton.OnCreate(object createParam)
|
||||
{
|
||||
}
|
||||
void IModule.OnDestroy()
|
||||
void ISingleton.OnDestroy()
|
||||
{
|
||||
_eventGroup.RemoveAllListener();
|
||||
}
|
||||
void IModule.OnUpdate()
|
||||
void ISingleton.OnUpdate()
|
||||
{
|
||||
if (_machine != null)
|
||||
_machine.Update();
|
||||
|
||||
Reference in New Issue
Block a user