Эх сурвалжийг харах

【优化】移除share unit相关

johnclot69 1 жил өмнө
parent
commit
0a500fcaa9
18 өөрчлөгдсөн 0 нэмэгдсэн , 333 устгасан
  1. 0 1
      DotNet/Hotfix/Helper/SceneFactory.cs
  2. 0 37
      Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitComponentSystem.cs
  3. 0 11
      Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitComponentSystem.cs.meta
  4. 0 11
      Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitSystem.cs
  5. 0 11
      Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitSystem.cs.meta
  6. 0 1
      Unity/Assets/Scripts/Codes/Model/Share/EventType.cs
  7. 0 83
      Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveComponent.cs
  8. 0 11
      Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveComponent.cs.meta
  9. 0 15
      Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveEventType.cs
  10. 0 11
      Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveEventType.cs.meta
  11. 0 62
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/Unit.cs
  12. 0 11
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/Unit.cs.meta
  13. 0 8
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitComponent.cs
  14. 0 11
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitComponent.cs.meta
  15. 0 18
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitEventType.cs
  16. 0 11
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitEventType.cs.meta
  17. 0 9
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitType.cs
  18. 0 11
      Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitType.cs.meta

+ 0 - 1
DotNet/Hotfix/Helper/SceneFactory.cs

@@ -35,7 +35,6 @@ namespace ET.Server
                     scene.AddComponent<GameSessionKeyComponent>();
                     break;
                 case SceneType.Map:
-                    scene.AddComponent<UnitComponent>();
                     break;
                 case SceneType.Location:
                     scene.AddComponent<LocationComponent>();

+ 0 - 37
Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitComponentSystem.cs

@@ -1,37 +0,0 @@
-namespace ET
-{
-	[ObjectSystem]
-	public class UnitComponentAwakeSystem : AwakeSystem<UnitComponent>
-	{
-		protected override void Awake(UnitComponent self)
-		{
-		}
-	}
-	
-	[ObjectSystem]
-	public class UnitComponentDestroySystem : DestroySystem<UnitComponent>
-	{
-		protected override void Destroy(UnitComponent self)
-		{
-		}
-	}
-	
-	public static class UnitComponentSystem
-	{
-		public static void Add(this UnitComponent self, Unit unit)
-		{
-		}
-
-		public static Unit Get(this UnitComponent self, long id)
-		{
-			Unit unit = self.GetChild<Unit>(id);
-			return unit;
-		}
-
-		public static void Remove(this UnitComponent self, long id)
-		{
-			Unit unit = self.GetChild<Unit>(id);
-			unit?.Dispose();
-		}
-	}
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitComponentSystem.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f7fbe1de137b21e4e88024c1411f792d
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 11
Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitSystem.cs

@@ -1,11 +0,0 @@
-namespace ET
-{
-    [ObjectSystem]
-    public class UnitSystem: AwakeSystem<Unit, int>
-    {
-        protected override void Awake(Unit self, int configId)
-        {
-            self.ConfigId = configId;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Hotfix/Share/Module/Unit/UnitSystem.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 9af1ba2890c2e524ca5fc31a4c2ee406
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 1
Unity/Assets/Scripts/Codes/Model/Share/EventType.cs

@@ -32,7 +32,6 @@
 
         public struct AfterUnitCreate
         {
-            public Unit Unit;
         }
     }
 }

+ 0 - 83
Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveComponent.cs

@@ -1,83 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Unity.Mathematics;
-
-namespace ET
-{
-    [ComponentOf(typeof(Unit))]
-    public class MoveComponent: Entity, IAwake, IDestroy
-    {
-        public float3 PreTarget
-        {
-            get
-            {
-                return this.Targets[this.N - 1];
-            }
-        }
-
-        public float3 NextTarget
-        {
-            get
-            {
-                return this.Targets[this.N];
-            }
-        }
-
-        // 开启移动协程的时间
-        public long BeginTime;
-
-        // 每个点的开始时间
-        public long StartTime { get; set; }
-
-        // 开启移动协程的Unit的位置
-        public float3 StartPos;
-
-        public float3 RealPos
-        {
-            get
-            {
-                return this.Targets[0];
-            }
-        }
-
-        private long needTime;
-
-        public long NeedTime
-        {
-            get
-            {
-                return this.needTime;
-            }
-            set
-            {
-                this.needTime = value;
-            }
-        }
-
-        public long MoveTimer;
-
-        public float Speed; // m/s
-
-        public ETTask<bool> tcs;
-
-        public List<float3> Targets = new List<float3>();
-
-        public float3 FinalTarget
-        {
-            get
-            {
-                return this.Targets[this.Targets.Count - 1];
-            }
-        }
-
-        public int N;
-
-        public int TurnTime;
-
-        public bool IsTurnHorizontal;
-
-        public quaternion From;
-
-        public quaternion To;
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveComponent.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 91e6974c200f3e9468684362d1489433
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 15
Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveEventType.cs

@@ -1,15 +0,0 @@
-namespace ET
-{
-    namespace EventType
-    {
-        public struct MoveStart
-        {
-            public Unit Unit;
-        }
-
-        public struct MoveStop
-        {
-            public Unit Unit;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Share/Module/Move/MoveEventType.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 0abfe3cf9ea0c8d41a0afe2920c080bb
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 62
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/Unit.cs

@@ -1,62 +0,0 @@
-using System.Diagnostics;
-using MongoDB.Bson.Serialization.Attributes;
-using Unity.Mathematics;
-
-namespace ET
-{
-    [ChildOf(typeof(UnitComponent))]
-    [DebuggerDisplay("ViewName,nq")]
-    public class Unit: Entity, IAwake<int>
-    {
-        public int ConfigId { get; set; } //配置表id
-
-        [BsonIgnore]
-        public UnitConfig Config => UnitConfigCategory.Instance.Get(this.ConfigId);
-
-        public UnitType Type => (UnitType)UnitConfigCategory.Instance.Get(this.ConfigId).Type;
-
-        [BsonElement]
-        private float3 position; //坐标
-
-        [BsonIgnore]
-        public float3 Position
-        {
-            get => this.position;
-            set
-            {
-                float3 oldPos = this.position;
-                this.position = value;
-                EventSystem.Instance.Publish(this.DomainScene(), new EventType.ChangePosition() { Unit = this, OldPos = oldPos });
-            }
-        }
-
-        [BsonIgnore]
-        public float3 Forward
-        {
-            get => math.mul(this.Rotation, math.forward());
-            set => this.Rotation = quaternion.LookRotation(value, math.up());
-        }
-        
-        [BsonElement]
-        private quaternion rotation;
-        
-        [BsonIgnore]
-        public quaternion Rotation
-        {
-            get => this.rotation;
-            set
-            {
-                this.rotation = value;
-                EventSystem.Instance.Publish(this.DomainScene(), new EventType.ChangeRotation() { Unit = this });
-            }
-        }
-
-        protected override string ViewName
-        {
-            get
-            {
-                return $"{this.GetType().Name} ({this.Id})";
-            }
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/Unit.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 3da3f3ce5b234ff4e9a0ac52abeb8638
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 8
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitComponent.cs

@@ -1,8 +0,0 @@
-namespace ET
-{
-	
-	[ComponentOf(typeof(Scene))]
-	public class UnitComponent: Entity, IAwake, IDestroy
-	{
-	}
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitComponent.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: e471c38a87a0d7d47a324bfcdb9fa160
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 18
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitEventType.cs

@@ -1,18 +0,0 @@
-using Unity.Mathematics;
-
-namespace ET
-{
-    namespace EventType
-    {
-        public struct ChangePosition
-        {
-            public Unit Unit;
-            public float3 OldPos;
-        }
-
-        public struct ChangeRotation
-        {
-            public Unit Unit;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitEventType.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 536f5650e527ebc4abd29873e5beaa23
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 9
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitType.cs

@@ -1,9 +0,0 @@
-namespace ET
-{
-    public enum UnitType: byte
-    {
-        Player = 1,
-        Monster = 2,
-        NPC = 3,
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Share/Module/Unit/UnitType.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 36e597b9a37681d43afd1812cf5008dc
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: