Ver código fonte

修复编译分析器错误

tanghai 1 ano atrás
pai
commit
f070b9282e
20 arquivos alterados com 25 adições e 17 exclusões
  1. 2 2
      Share/Analyzer/Analyzer/DisableNormalClassDeclaratonInModelAssemblyAnalyzer.cs
  2. 2 2
      Share/Analyzer/Config/DiagnosticRules.cs
  3. 1 0
      Unity/Assets/Scripts/Core/Object/Object.cs
  4. 1 0
      Unity/Assets/Scripts/Core/World/Module/EventSystem/BaseAttribute.cs
  5. 1 1
      Unity/Assets/Scripts/Hotfix/Client/Demo/Main/ClientSenderComponentSystem.cs.meta
  6. 2 2
      Unity/Assets/Scripts/HotfixView/Client/Demo/Opera/OperaComponentSystem.cs
  7. 1 1
      Unity/Assets/Scripts/Model/Client/Demo/Main/ClientSenderComponent.cs.meta
  8. 1 1
      Unity/Assets/Scripts/Model/Server/Demo/Robot/Console/CreateRobotArgs.cs
  9. 1 1
      Unity/Assets/Scripts/Model/Share/LockStep/FixedTimeCounter.cs
  10. 1 1
      Unity/Assets/Scripts/Model/Share/LockStep/FrameBuffer.cs
  11. 1 0
      Unity/Assets/Scripts/Model/Share/LockStep/ILSRollbackSystem.cs
  12. 2 1
      Unity/Assets/Scripts/Model/Share/LockStep/ILSUpdateSystem.cs
  13. 1 1
      Unity/Assets/Scripts/Model/Share/LockStep/LSUpdater.cs
  14. 1 1
      Unity/Assets/Scripts/Model/Share/LockStep/Replay.cs
  15. 1 0
      Unity/Assets/Scripts/Model/Share/Module/AI/AAIHandler.cs
  16. 1 0
      Unity/Assets/Scripts/Model/Share/Module/Message/MessageSessionDispatcher.cs
  17. 2 1
      Unity/Assets/Scripts/Model/Share/Module/Message/MessageSessionHandler.cs
  18. 1 1
      Unity/Assets/Scripts/Model/Share/Module/Numeric/NumericWatcherComponent.cs
  19. 1 1
      Unity/Assets/Scripts/Model/Share/Module/ObjectWait/ObjectWait.cs
  20. 1 0
      Unity/Assets/Scripts/ModelView/Client/Module/UI/AUIEvent.cs

+ 2 - 2
Share/Analyzer/Analyzer/DisableNormalClassDeclaratonInModelAssemblyAnalyzer.cs

@@ -43,12 +43,12 @@ namespace ET.Analyzer
                 return;
             }
 
-            if (namedTypeSymbol.IsETEntity())
+            if (namedTypeSymbol.IsStatic)
             {
                 return;
             }
 
-            if (namedTypeSymbol.HasAttribute(Definition.EnableClassAttribute))
+            if (namedTypeSymbol.HasAttributeInTypeAndBaseTyes(Definition.EnableClassAttribute))
             {
                 return;
             }

+ 2 - 2
Share/Analyzer/Config/DiagnosticRules.cs

@@ -473,9 +473,9 @@ namespace ET.Analyzer
     {
         private const string Title = "Model/ModelView程序集禁止声明非实体类";
 
-        private const string MessageFormat = "Model/ModelView程序集禁止声明非实体类:{0}";
+        private const string MessageFormat = "Model/ModelView程序集禁止声明非Object类:{0}, 除非加上[EnableClass]";
 
-        private const string Description = "Model/ModelView程序集禁止声明非实体类.";
+        private const string Description = "Model/ModelView程序集禁止声明非实体类, 除非加上[EnableClass] Attribute.";
 
         public static readonly DiagnosticDescriptor Rule =
                 new DiagnosticDescriptor(DiagnosticIds.DisableNormalClassDeclaratonInModelAssemblyAnalyzerRuleId,

+ 1 - 0
Unity/Assets/Scripts/Core/Object/Object.cs

@@ -2,6 +2,7 @@
 
 namespace ET
 {
+    [EnableClass]
     public abstract class Object
     {
         public override string ToString()

+ 1 - 0
Unity/Assets/Scripts/Core/World/Module/EventSystem/BaseAttribute.cs

@@ -3,6 +3,7 @@
 namespace ET
 {
 	[AttributeUsage(AttributeTargets.Class)]
+	[EnableClass]
 	public class BaseAttribute: Attribute
 	{
 	}

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Client/Demo/Main/ClientSenderCompnentSystem.cs.meta → Unity/Assets/Scripts/Hotfix/Client/Demo/Main/ClientSenderComponentSystem.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: a11bff036359a2143aca1de23150ce40
+guid: aa372ebdea28c6347a1d74e60f335934
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 2 - 2
Unity/Assets/Scripts/HotfixView/Client/Demo/Opera/OperaComponentSystem.cs

@@ -23,7 +23,7 @@ namespace ET.Client
                 {
                     C2M_PathfindingResult c2MPathfindingResult = C2M_PathfindingResult.Create();
                     c2MPathfindingResult.Position = hit.point;
-                    self.Root().GetComponent<ClientSenderCompnent>().Send(c2MPathfindingResult);
+                    self.Root().GetComponent<ClientSenderComponent>().Send(c2MPathfindingResult);
                 }
             }
             
@@ -46,7 +46,7 @@ namespace ET.Client
             if (Input.GetKeyDown(KeyCode.T))
             {
                 C2M_TransferMap c2MTransferMap = C2M_TransferMap.Create();
-                self.Root().GetComponent<ClientSenderCompnent>().Call(c2MTransferMap).Coroutine();
+                self.Root().GetComponent<ClientSenderComponent>().Call(c2MTransferMap).Coroutine();
             }
         }
         

+ 1 - 1
Unity/Assets/Scripts/Model/Client/Demo/Main/ClientSenderCompnent.cs.meta → Unity/Assets/Scripts/Model/Client/Demo/Main/ClientSenderComponent.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 382c2c68ed7679d46a55104e0cc8b994
+guid: 6a1a5585b18d25a43a66b5c0529f32d6
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 1 - 1
Unity/Assets/Scripts/Model/Server/Demo/Robot/Console/CreateRobotArgs.cs

@@ -2,7 +2,7 @@ using CommandLine;
 
 namespace ET.Server
 {
-    public class CreateRobotArgs
+    public class CreateRobotArgs: Object
     {
         [Option("Num", Required = false, Default = 1)]
         public int Num { get; set; }

+ 1 - 1
Unity/Assets/Scripts/Model/Share/LockStep/FixedTimeCounter.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class FixedTimeCounter
+    public class FixedTimeCounter: Object
     {
         private long startTime;
         private int startFrame;

+ 1 - 1
Unity/Assets/Scripts/Model/Share/LockStep/FrameBuffer.cs

@@ -4,7 +4,7 @@ using System.IO;
 
 namespace ET
 {
-    public class FrameBuffer
+    public class FrameBuffer: Object
     {
         public int MaxFrame { get; private set; }
         private readonly List<OneFrameInputs> frameInputs;

+ 1 - 0
Unity/Assets/Scripts/Model/Share/LockStep/ILSRollbackSystem.cs

@@ -12,6 +12,7 @@ namespace ET
         void Run(Entity o);
     }
     
+    [EnableClass]
     [LSEntitySystem]
     public abstract class LSRollbackSystem<T> : ILSRollbackSystem where T: Entity, ILSRollback
     {

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

@@ -10,7 +10,8 @@ namespace ET
     {
         void Run(LSEntity o);
     }
-    
+
+    [EnableClass]
     [LSEntitySystem]
     public abstract class LSUpdateSystem<T> : ILSUpdateSystem where T: LSEntity, ILSUpdate
     {

+ 1 - 1
Unity/Assets/Scripts/Model/Share/LockStep/LSUpdater.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 namespace ET
 {
-    public class LSUpdater
+    public class LSUpdater: Object
     {
         private List<long> updateIds = new();
         private List<long> newUpdateIds = new();

+ 1 - 1
Unity/Assets/Scripts/Model/Share/LockStep/Replay.cs

@@ -4,7 +4,7 @@ using MemoryPack;
 namespace ET
 {
     [MemoryPackable]
-    public partial class Replay
+    public partial class Replay: Object
     {
         [MemoryPackOrder(1)]
         public List<LockStepUnitInfo> UnitInfos;

+ 1 - 0
Unity/Assets/Scripts/Model/Share/Module/AI/AAIHandler.cs

@@ -6,6 +6,7 @@ namespace ET
     {
     }
     
+    [EnableClass]
     [AIHandler]
     public abstract class AAIHandler
     {

+ 1 - 0
Unity/Assets/Scripts/Model/Share/Module/Message/MessageSessionDispatcher.cs

@@ -3,6 +3,7 @@ using System;
 
 namespace ET
 {
+    [EnableClass]
     public class MessageSessionDispatcherInfo
     {
         public SceneType SceneType { get; }

+ 2 - 1
Unity/Assets/Scripts/Model/Share/Module/Message/MessageSessionHandler.cs

@@ -2,6 +2,7 @@ using System;
 
 namespace ET
 {
+    [EnableClass]
     public abstract class MessageSessionHandler<Message>: IMessageSessionHandler where Message : MessageObject
     {
         protected abstract ETTask Run(Session session, Message message);
@@ -39,7 +40,7 @@ namespace ET
         }
     }
     
-    
+    [EnableClass]
     public abstract class MessageSessionHandler<Request, Response>: IMessageSessionHandler where Request : MessageObject, IRequest where Response : MessageObject, IResponse
     {
         protected abstract ETTask Run(Session session, Request request, Response response);

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/Numeric/NumericWatcherComponent.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 namespace ET
 {
-    public class NumericWatcherInfo
+    public class NumericWatcherInfo: Object
     {
         public SceneType SceneType { get; }
         public INumericWatcher INumericWatcher { get; }

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/ObjectWait/ObjectWait.cs

@@ -45,7 +45,7 @@ namespace ET
             void SetResult();
         }
 
-        private class ResultCallback<K>: IDestroyRun where K : struct, IWaitType
+        private class ResultCallback<K>: Object, IDestroyRun where K : struct, IWaitType
         {
             private ETTask<K> tcs;
 

+ 1 - 0
Unity/Assets/Scripts/ModelView/Client/Module/UI/AUIEvent.cs

@@ -1,5 +1,6 @@
 namespace ET.Client
 {
+    [EnableClass]
     public abstract class AUIEvent
     {
         public abstract ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer);