Ver Fonte

合并IScene的更改

# Conflicts:
#	Unity/Assets/Scripts/Codes/Model/Server/Module/Http/IHttpHandler.cs
#	Unity/Assets/Scripts/Core/Module/EventSystem/IEvent.cs
tanghai há 2 anos atrás
pai
commit
f6b8df03c7

+ 1 - 1
Unity/Assets/Scripts/Codes/Model/Server/Module/Http/IHttpHandler.cs

@@ -4,6 +4,6 @@ namespace ET.Server
 {
     public interface IHttpHandler
     {
-        ETTask Handle(Scene domain, HttpListenerContext context);
+        ETTask Handle(Scene scene, HttpListenerContext context);
     }
 }

+ 1 - 1
Unity/Assets/Scripts/Core/Module/Entity/Entity.cs

@@ -258,7 +258,7 @@ namespace ET
                 this.parent = value;
                 this.IsComponent = true;
                 this.parent.AddToComponents(this);
-                this.Domain = this.parent.domain;
+                this.Domain = this is IScene? this as IScene : this.parent.domain;
             }
         }
 

+ 2 - 2
Unity/Assets/Scripts/Core/Module/Entity/SceneHelper.cs

@@ -4,12 +4,12 @@ namespace ET
     {
         public static int DomainZone(this Entity entity)
         {
-            return ((Scene) entity.Domain)?.Zone ?? 0;
+            return (entity.Domain as Scene)?.Zone ?? 0;
         }
 
         public static Scene DomainScene(this Entity entity)
         {
-            return (Scene) entity.Domain;
+            return entity.Domain as Scene;
         }
     }
 }

+ 2 - 2
Unity/Assets/Scripts/Core/Module/EventSystem/IEvent.cs

@@ -19,11 +19,11 @@ namespace ET
 
 		protected abstract ETTask Run(S scene, A a);
 
-		public async ETTask Handle(IScene scene, A a)
+		public async ETTask Handle(S scene, A a)
 		{
 			try
 			{
-				await Run(scene as S, a);
+				await Run(scene, a);
 			}
 			catch (Exception e)
 			{