Просмотр исходного кода

RollbackSystem改成LSRollbackSystem,保持统一LS打头

tanghai 2 лет назад
Родитель
Сommit
0945887ef7

+ 1 - 1
Unity/Assets/Resources/GlobalConfig.asset

@@ -12,6 +12,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 36527db572638af47b03c805671cba75, type: 3}
   m_Name: GlobalConfig
   m_EditorClassIdentifier: 
-  CodeMode: 1
+  CodeMode: 3
   BuildType: 1
   AppType: 8

+ 6 - 6
Unity/Assets/Scripts/Hotfix/Client/LockStep/LSClientHelper.cs

@@ -5,20 +5,20 @@ namespace ET
 {
     public static partial class LSClientHelper
     {
-        public static void RunRollbackSystem(Entity entity)
+        public static void RunLSRollbackSystem(Entity entity)
         {
             if (entity is LSEntity)
             {
                 return;
             }
             
-            LSEntitySystemSington.Instance.Rollback(entity);
+            LSEntitySystemSington.Instance.LSRollback(entity);
             
             if (entity.ComponentsCount() > 0)
             {
                 foreach (var kv in entity.Components)
                 {
-                    RunRollbackSystem(kv.Value);
+                    RunLSRollbackSystem(kv.Value);
                 }
             }
 
@@ -26,7 +26,7 @@ namespace ET
             {
                 foreach (var kv in entity.Children)
                 {
-                    RunRollbackSystem(kv.Value);
+                    RunLSRollbackSystem(kv.Value);
                 }
             }
         }
@@ -53,7 +53,7 @@ namespace ET
                 room.Update(oneFrameInputs);
             }
             
-            RunRollbackSystem(room);
+            RunLSRollbackSystem(room);
         }
         
         public static void SendHash(this Room self, int frame)
@@ -116,7 +116,7 @@ namespace ET
                 LSWorld lsWorld = MongoHelper.Deserialize(typeof (LSWorld), memoryBuffer, 0, memoryBuffer.Length) as LSWorld;
                 room.LSWorld = lsWorld;
                 room.AuthorityFrame = snapshotIndex * LSConstValue.SaveLSWorldFrameCount;
-                RunRollbackSystem(room);
+                RunLSRollbackSystem(room);
             }
             
             room.FixedTimeCounter.Reset(TimeHelper.ServerFrameTime() - frame * LSConstValue.UpdateInterval, 0);

+ 1 - 1
Unity/Assets/Scripts/HotfixView/Client/LockStep/LSUnitViewSystem.cs

@@ -15,7 +15,7 @@ namespace ET.Client
         }
         
         [LSEntitySystem]
-        private static void Rollback(this LSUnitView self)
+        private static void LSRollback(this LSUnitView self)
         {
             //LSUnit unit = self.GetUnit();
             //self.Transform.position = unit.Position.ToVector();

+ 7 - 7
Unity/Assets/Scripts/Model/Share/LockStep/IRollbackSystem.cs → Unity/Assets/Scripts/Model/Share/LockStep/ILSRollbackSystem.cs

@@ -3,21 +3,21 @@ using System.Collections.Generic;
 
 namespace ET
 {
-    public interface IRollback
+    public interface ILSRollback
     {
     }
     
-    public interface IRollbackSystem: ISystemType
+    public interface ILSRollbackSystem: ISystemType
     {
         void Run(Entity o);
     }
     
     [LSEntitySystem]
-    public abstract class RollbackSystem<T> : IRollbackSystem where T: Entity, IRollback
+    public abstract class LSRollbackSystem<T> : ILSRollbackSystem where T: Entity, ILSRollback
     {
-        void IRollbackSystem.Run(Entity o)
+        void ILSRollbackSystem.Run(Entity o)
         {
-            this.Rollback((T)o);
+            this.LSRollback((T)o);
         }
 
         Type ISystemType.Type()
@@ -27,7 +27,7 @@ namespace ET
 
         Type ISystemType.SystemType()
         {
-            return typeof(IRollbackSystem);
+            return typeof(ILSRollbackSystem);
         }
 
         int ISystemType.GetInstanceQueueIndex()
@@ -35,6 +35,6 @@ namespace ET
             return InstanceQueueIndex.None;
         }
 
-        protected abstract void Rollback(T self);
+        protected abstract void LSRollback(T self);
     }
 }

+ 1 - 1
Unity/Assets/Scripts/Model/Share/LockStep/IRollbackSystem.cs.meta → Unity/Assets/Scripts/Model/Share/LockStep/ILSRollbackSystem.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 7546247cabef944a2a91d0b99fbd241b
+guid: 27067471cd1c7d045bb855b9f4f4c9b4
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 7 - 7
Unity/Assets/Scripts/Model/Share/LockStep/LSEntitySystemSington.cs

@@ -47,29 +47,29 @@ namespace ET
             return this.typeSystems.GetOneTypeSystems(type);
         }
         
-        public void Rollback(Entity entity)
+        public void LSRollback(Entity entity)
         {
-            if (entity is not IRollback)
+            if (entity is not ILSRollback)
             {
                 return;
             }
             
-            List<object> iRollbackSystems = this.typeSystems.GetSystems(entity.GetType(), typeof (IRollbackSystem));
-            if (iRollbackSystems == null)
+            List<object> iLSRollbackSystems = this.typeSystems.GetSystems(entity.GetType(), typeof (ILSRollbackSystem));
+            if (iLSRollbackSystems == null)
             {
                 return;
             }
 
-            foreach (IRollbackSystem iRollbackSystem in iRollbackSystems)
+            foreach (ILSRollbackSystem iLSRollbackSystem in iLSRollbackSystems)
             {
-                if (iRollbackSystem == null)
+                if (iLSRollbackSystem == null)
                 {
                     continue;
                 }
 
                 try
                 {
-                    iRollbackSystem.Run(entity);
+                    iLSRollbackSystem.Run(entity);
                 }
                 catch (Exception e)
                 {

+ 1 - 1
Unity/Assets/Scripts/ModelView/Client/LockStep/LSUnitView.cs

@@ -3,7 +3,7 @@ using UnityEngine;
 namespace ET
 {
     [ChildOf(typeof(LSUnitViewComponent))]
-    public class LSUnitView: Entity, IAwake<GameObject>, IUpdate, IRollback
+    public class LSUnitView: Entity, IAwake<GameObject>, IUpdate, ILSRollback
     {
         public GameObject GameObject { get; set; }
         public Transform Transform { get; set; }