diff options
13 files changed, 120 insertions, 17 deletions
diff --git a/Documents/参考.txt b/Documents/参考.txt new file mode 100644 index 0000000..87a4fc7 --- /dev/null +++ b/Documents/参考.txt @@ -0,0 +1,2 @@ +https://www.youtube.com/watch?v=1YOi66c1j1o&ab_channel=PFY%E7%8E%A9%E7%B5%A6%E4%BD%A0%E7%9C%8B +https://www.youtube.com/watch?v=gKlv10IO2D4&ab_channel=PFY%E7%8E%A9%E7%B5%A6%E4%BD%A0%E7%9C%8B
\ No newline at end of file diff --git a/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs b/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs index 886446a..40b00a7 100644 --- a/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs +++ b/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs @@ -12,15 +12,25 @@ namespace WK.Data { /// <summary> - /// 첽 + /// 첽 /// </summary> /// <returns></returns> - public IEnumerator<float> AsyncLoadAllData() + public CoroutineHandle AsyncLoadAll() + { + return Timing.Instance.RunCoroutineOnInstance(AsyncLoadAllData()); + } + + private IEnumerator<float> AsyncLoadAllData() { Load_Filelist(); yield return Timing.WaitForSeconds(StaticDefine.IntervalLoadFile); } + #region + + /// <summary> + /// fielist + /// </summary> private void Load_Filelist() { TextAsset text = ResourceManager.Instance.LoadAsset<TextAsset>(StaticDefine.FileList); @@ -34,5 +44,7 @@ namespace WK.Data } } + #endregion + } }
\ No newline at end of file diff --git a/WorldlineKeepers/Assets/Scripts/Data/FileKey.cs b/WorldlineKeepers/Assets/Scripts/Data/FileKey.cs new file mode 100644 index 0000000..1ab15b2 --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Data/FileKey.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace WK.Data +{ + + /// <summary> + /// ļenum + /// </summary> + public enum EFileKey + { + none = 0, + + default_stats, + default_buffs, + default_items, + + all + } + +} diff --git a/WorldlineKeepers/Assets/Scripts/Data/FileKey.cs.meta b/WorldlineKeepers/Assets/Scripts/Data/FileKey.cs.meta new file mode 100644 index 0000000..1564c3d --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Data/FileKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 024b24790fd0abd4181e4b690d9fb4ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/WorldlineKeepers/Assets/Scripts/Data/Filelist.cs b/WorldlineKeepers/Assets/Scripts/Data/Filelist.cs index 094c1ea..dc96df9 100644 --- a/WorldlineKeepers/Assets/Scripts/Data/Filelist.cs +++ b/WorldlineKeepers/Assets/Scripts/Data/Filelist.cs @@ -19,13 +19,6 @@ namespace WK.Data Persistent = 2, } - public enum EFileKey - { - default_stats = 1, - default_buffs = 2, - default_items = 3, - } - /// <summary> /// ļб /// </summary> diff --git a/WorldlineKeepers/Assets/Scripts/Stages/GameStageBase.cs b/WorldlineKeepers/Assets/Scripts/Stages/GameStageBase.cs index 430c2d8..19b3535 100644 --- a/WorldlineKeepers/Assets/Scripts/Stages/GameStageBase.cs +++ b/WorldlineKeepers/Assets/Scripts/Stages/GameStageBase.cs @@ -9,7 +9,7 @@ namespace WK public class GameStageBase : AsyncStatemachine.State { - protected GameStageManager manager = GameStageManager.Instance; + protected GameStageManager owner = GameStageManager.Instance; public override IEnumerator<float> OnStart() { diff --git a/WorldlineKeepers/Assets/Scripts/Stages/GameStageManager.cs b/WorldlineKeepers/Assets/Scripts/Stages/GameStageManager.cs index 8c746a5..a28e56d 100644 --- a/WorldlineKeepers/Assets/Scripts/Stages/GameStageManager.cs +++ b/WorldlineKeepers/Assets/Scripts/Stages/GameStageManager.cs @@ -60,10 +60,10 @@ namespace WK { } - public void AsyncLoadStage(int stage, bool forceLoad = false, AsyncStatemachine.LoadStateComplete loadStateComplete = null) + public void AsyncLoadStage(EGameStage stage, bool forceLoad = false, AsyncStatemachine.LoadStateComplete loadStateComplete = null) { int curRunStage = m_Statemachine.GetCurStateID(); - if (!forceLoad && curRunStage == stages[stage]) + if (!forceLoad && curRunStage == stages[(int)stage]) { if (null != loadStateComplete) { @@ -75,11 +75,10 @@ namespace WK //LogHelper.LogEditorError("==> StageChange:" + curStage + " --> " + (EGameStage)stage); prevStage = curStage; - curStage = (EGameStage)stage; + curStage = stage; m_Statemachine.GotoState(stages[(int)stage], false, forceLoad, loadStateComplete); } - public EGameStage GetCurStage() { return curStage; diff --git a/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/Statemachine.cs b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/BasicStatemachine.cs index b54b5e1..15ab82c 100644 --- a/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/Statemachine.cs +++ b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/BasicStatemachine.cs @@ -5,14 +5,16 @@ using Newtonsoft.Json.Utilities; namespace WK { - - public class BaseStateMachine + /// <summary> + /// һ״̬ + /// </summary> + public class BasicStatemachine { public delegate void StateEvent(); public delegate bool StateFinishChecker(); public class State { - public BaseStateMachine owner; + public BasicStatemachine owner; public int stateId; public virtual void BeginState() diff --git a/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/Statemachine.cs.meta b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/BasicStatemachine.cs.meta index 1f9dc33..1f9dc33 100644 --- a/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/Statemachine.cs.meta +++ b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/BasicStatemachine.cs.meta diff --git a/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/LiteStatemachine.cs b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/LiteStatemachine.cs new file mode 100644 index 0000000..f119866 --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/LiteStatemachine.cs @@ -0,0 +1,23 @@ +using JetBrains.Annotations; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace WK +{ + + /// <summary> + /// ״̬ + /// </summary> + public abstract class LiteStatemachine + { + + + public void GotoState(int target) + { + + } + + } + +} diff --git a/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/LiteStatemachine.cs.meta b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/LiteStatemachine.cs.meta new file mode 100644 index 0000000..1243aac --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Tools/Statemachine/LiteStatemachine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8fe740cda5abcf489e9188cdd7150ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/WorldlineKeepers/Assets/Scripts/Utils/AsyncUtils.cs b/WorldlineKeepers/Assets/Scripts/Utils/AsyncUtils.cs new file mode 100644 index 0000000..14bbc86 --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Utils/AsyncUtils.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using MovementEffects; + +namespace WK +{ + public static class AsyncUtils + { + public static CoroutineHandle AsyncAction(IEnumerator<float> asyncAct) + { + var handle = Timing.Instance.RunCoroutineOnInstance(asyncAct); + return handle; + } + + } +} diff --git a/WorldlineKeepers/Assets/Scripts/Utils/AsyncUtils.cs.meta b/WorldlineKeepers/Assets/Scripts/Utils/AsyncUtils.cs.meta new file mode 100644 index 0000000..7540550 --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Utils/AsyncUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59a14efd34714d1498d15731d63bfdfe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |