Răsfoiți Sursa

增加LSEntitySystem Source Generator模板,用于帧同步的System

tanghai 2 ani în urmă
părinte
comite
65627ceaa6

+ 12 - 0
Share/Share.SourceGenerator/Generator/ETSystemGenerator/AttributeTemplate.cs

@@ -22,6 +22,18 @@ namespace ET.Generator
                         }
                         }
                 """);
                 """);
             
             
+            this.templates.Add("LSEntitySystem", 
+                $$"""
+                $attribute$
+                        public class $argsTypesUnderLine$_$methodName$System: $methodName$System<$argsTypes$>
+                        {   
+                            protected override void $methodName$($argsTypesVars$)
+                            {
+                                $argsVars0$.$methodName$($argsVarsWithout0$);
+                            }
+                        }
+                """);
+            
             this.templates.Add("MessageHandler", 
             this.templates.Add("MessageHandler", 
                 $$"""
                 $$"""
                 $attribute$
                 $attribute$

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

@@ -14,4 +14,4 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   CodeMode: 3
   CodeMode: 3
   BuildType: 1
   BuildType: 1
-  AppType: 7
+  AppType: 8

+ 1 - 5
Unity/Assets/Scripts/Core/Module/EventSystem/EntitySystemAttribute.cs

@@ -2,12 +2,8 @@
 
 
 namespace ET
 namespace ET
 {
 {
-	public class SystemAttribute: BaseAttribute
-	{
-	}
-	
 	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
 	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
-	public class EntitySystemAttribute: SystemAttribute
+	public class EntitySystemAttribute: BaseAttribute
 	{
 	{
 	}
 	}
 }
 }

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Share/LockStep/LSInputComponentSystem.cs

@@ -6,7 +6,7 @@ namespace ET
 {
 {
     public static partial class LSInputComponentSystem
     public static partial class LSInputComponentSystem
     {
     {
-        [EntitySystem]
+        [LSEntitySystem]
         public static void LSUpdate(this LSInputComponent self)
         public static void LSUpdate(this LSInputComponent self)
         {
         {
             LSUnit unit = self.GetParent<LSUnit>();
             LSUnit unit = self.GetParent<LSUnit>();

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

@@ -14,7 +14,7 @@ namespace ET.Client
             
             
         }
         }
         
         
-        [EntitySystem]
+        [LSEntitySystem]
         private static void Rollback(this LSUnitView self)
         private static void Rollback(this LSUnitView self)
         {
         {
             //LSUnit unit = self.GetUnit();
             //LSUnit unit = self.GetUnit();

+ 2 - 2
Unity/Assets/Scripts/Model/Share/LockStep/LSEntitySystemAttribute.cs

@@ -2,8 +2,8 @@ using System;
 
 
 namespace ET
 namespace ET
 {
 {
-    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-    public class LSEntitySystemAttribute: SystemAttribute
+    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
+    public class LSEntitySystemAttribute: BaseAttribute
     {
     {
     }
     }
 }
 }