From 0c6d59f53e0f6b040699f3d7dc64610134228ef4 Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Thu, 10 Aug 2023 10:09:59 +0800 Subject: [PATCH] Fixed BehaviourSingleton #45 Fixed BehaviourSingleton #45 --- .../HotFix/GameBase/BehaviourSingleton.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Assets/GameScripts/HotFix/GameBase/BehaviourSingleton.cs b/Assets/GameScripts/HotFix/GameBase/BehaviourSingleton.cs index 1f40a15c..9b59d9c4 100644 --- a/Assets/GameScripts/HotFix/GameBase/BehaviourSingleton.cs +++ b/Assets/GameScripts/HotFix/GameBase/BehaviourSingleton.cs @@ -1,12 +1,13 @@ -using System; +using System; using System.Collections.Generic; namespace TEngine { /// /// 通过LogicSys来驱动且具备Unity完整生命周期的单例(不继承MonoBehaviour)。 + /// Update、FixUpdate以及LateUpdate这些敏感帧更新需要加上对应的Attribute以最优化性能。 /// - /// + /// 完整生命周期的类型。 public abstract class BehaviourSingleton : BaseBehaviourSingleton where T : BaseBehaviourSingleton, new() { private static T _instance; @@ -45,11 +46,6 @@ namespace TEngine { } - public virtual bool IsHaveLateUpdate() - { - return false; - } - public virtual void Start() { } @@ -159,7 +155,6 @@ namespace TEngine { var listStart = _listStart; var listToUpdate = _listUpdate; - var listToLateUpdate = _listLateUpdate; if (listStart.Count > 0) { for (int i = 0; i < listStart.Count; i++) @@ -169,12 +164,6 @@ namespace TEngine inst.IsStart = true; inst.Start(); - listToUpdate.Add(inst); - - if (inst.IsHaveLateUpdate()) - { - listToLateUpdate.Add(inst); - } } listStart.Clear();