Prechádzať zdrojové kódy

所有数据结构统一成Unit,使用组件搭载不同的数据

tanghai 9 rokov pred
rodič
commit
5f0339ae01
27 zmenil súbory, kde vykonal 354 pridanie a 287 odobranie
  1. 6 6
      Unity/Assets/Scripts/Base/Network/AChannel.cs
  2. 0 6
      Unity/Assets/Scripts/Base/Network/TNet/TService.cs
  3. 7 14
      Unity/Assets/Scripts/Base/Object/Component.cs
  4. 0 12
      Unity/Assets/Scripts/Base/Object/IOpen.cs
  5. 0 56
      Unity/Assets/Scripts/Base/Object/ObjectManager.cs
  6. 10 10
      Unity/Assets/Scripts/Base/Object/Unit.cs
  7. 0 0
      Unity/Assets/Scripts/Base/Object/Unit.cs.meta
  8. 90 0
      Unity/Assets/Scripts/Component/ChildrenComponent.cs
  9. 0 0
      Unity/Assets/Scripts/Component/ChildrenComponent.cs.meta
  10. 6 5
      Unity/Assets/Scripts/Component/Game.cs
  11. 23 0
      Unity/Assets/Scripts/Component/GameObjectComponent.cs
  12. 2 2
      Unity/Assets/Scripts/Component/GameObjectComponent.cs.meta
  13. 0 18
      Unity/Assets/Scripts/Component/KVComponent.cs
  14. 0 37
      Unity/Assets/Scripts/Component/Scene.cs
  15. 0 102
      Unity/Assets/Scripts/Component/Scene/ChildrenComponent.cs
  16. 7 6
      Unity/Assets/Scripts/Component/Scene/MessageComponent.cs
  17. 34 0
      Unity/Assets/Scripts/Component/Scene/Scene.cs
  18. 2 2
      Unity/Assets/Scripts/Component/Scene/Scene.cs.meta
  19. 6 5
      Unity/Assets/Scripts/Component/Share.cs
  20. 9 0
      Unity/Assets/Scripts/Component/UI.meta
  21. 21 0
      Unity/Assets/Scripts/Component/UI/UI.cs
  22. 12 0
      Unity/Assets/Scripts/Component/UI/UI.cs.meta
  23. 1 1
      Unity/Assets/Scripts/Message/AMEvent.cs
  24. 98 0
      Unity/Assets/Scripts/Other/UIType.cs
  25. 12 0
      Unity/Assets/Scripts/Other/UIType.cs.meta
  26. 1 1
      Unity/Controller/Message/S2C_InitBuffInfoEvent.cs
  27. 7 4
      Unity/Unity.CSharp.csproj

+ 6 - 6
Unity/Assets/Scripts/Base/Network/AChannel.cs

@@ -12,12 +12,14 @@ namespace Base
 		NoAllocate = 1 << 2
 	}
 
-	public abstract class AChannel: Entity
+	public abstract class AChannel: IDisposable
 	{
+		public long Id { get; private set; }
 		protected AService service;
 
 		protected AChannel(AService service)
 		{
+			this.Id = IdGenerater.GenerateId();
 			this.service = service;
 		}
 
@@ -35,18 +37,16 @@ namespace Base
 		/// </summary>
 		public abstract byte[] Recv();
 
-		public override void Dispose()
+		public virtual void Dispose()
 		{
 			if (this.Id == 0)
 			{
 				return;
 			}
 
-			long id = this.Id;
+			this.service.Remove(this.Id);
 
-			base.Dispose();
-
-			this.service.Remove(id);
+			this.Id = 0;
 		}
 	}
 }

+ 0 - 6
Unity/Assets/Scripts/Base/Network/TNet/TService.cs

@@ -29,15 +29,9 @@ namespace Base
 			this.poller = null;
 		}
 
-		~TService()
-		{
-			this.Dispose(false);
-		}
-
 		public override void Dispose()
 		{
 			this.Dispose(true);
-			GC.SuppressFinalize(this);
 		}
 
 		public override void Add(Action action)

+ 7 - 14
Unity/Assets/Scripts/Base/Object/Component.cs

@@ -1,23 +1,11 @@
-using MongoDB.Bson.Serialization.Attributes;
-
-namespace Base
+namespace Base
 {
 	/// <summary>
 	/// Component的Id与Owner Entity Id一样
 	/// </summary>
 	public abstract class Component: Object
 	{
-		private Entity owner;
-		
-		public T GetOwner<T>() where T: Entity
-		{
-			return this.owner as T;
-		}
-
-		public void SetOwner(Entity entity)
-		{
-			this.owner = entity;
-		}
+		public Unit Owner { get; set; }
 
 		protected Component()
 		{
@@ -29,6 +17,11 @@ namespace Base
 			ObjectManager.Add(this);
 		}
 
+		public T GetComponent<T>() where T: Component
+		{
+			return this.Owner.GetComponent<T>();
+		}
+
 		public override void Dispose()
 		{
 			base.Dispose();

+ 0 - 12
Unity/Assets/Scripts/Base/Object/IOpen.cs

@@ -1,12 +0,0 @@
-namespace Base
-{
-    public interface IOpen
-    {
-        void Open();
-    }
-
-    public interface IClose
-    {
-        void Close();
-    }
-}

+ 0 - 56
Unity/Assets/Scripts/Base/Object/ObjectManager.cs

@@ -158,62 +158,6 @@ namespace Base
 			this.objects.Remove(id);
 		}
 
-		public void Open(long id)
-		{
-			Object obj;
-			if (!objects.TryGetValue(id, out obj))
-			{
-				return;
-			}
-			IObjectEvent e;
-			if (!objectEvents.TryGetValue(obj.GetType(), out e))
-			{
-				return;
-			}
-			IOpen open = e as IOpen;
-			if (open == null)
-			{
-				return;
-			}
-			try
-			{
-				e.SetValue(obj);
-				open.Open();
-			}
-			catch (Exception exc)
-			{
-				Log.Error(exc.ToString());
-			}
-		}
-
-		public void Close(long id)
-		{
-			Object obj;
-			if (!objects.TryGetValue(id, out obj))
-			{
-				return;
-			}
-			IObjectEvent e;
-			if (!objectEvents.TryGetValue(obj.GetType(), out e))
-			{
-				return;
-			}
-			IClose close = e as IClose;
-			if (close == null)
-			{
-				return;
-			}
-			try
-			{
-				e.SetValue(obj);
-				close.Close();
-			}
-			catch (Exception exc)
-			{
-				Log.Error(exc.ToString());
-			}
-		}
-
 		public void Awake(long id)
 		{
 			Object obj;

+ 10 - 10
Unity/Assets/Scripts/Base/Object/Entity.cs → Unity/Assets/Scripts/Base/Object/Unit.cs

@@ -6,25 +6,25 @@ using MongoDB.Bson.Serialization.Attributes;
 
 namespace Base
 {
-	public abstract class Entity: Object
+	public sealed class Unit: Object
 	{
 		[BsonElement, BsonIgnoreIfNull]
 		private HashSet<Component> components = new HashSet<Component>();
 		private Dictionary<Type, Component> componentDict = new Dictionary<Type, Component>();
 		
-		protected Entity()
+		public Unit()
 		{
 			ObjectManager.Add(this);
 		}
 
-		protected Entity(long id): base(id)
+		public Unit(long id): base(id)
 		{
 			ObjectManager.Add(this);
 		}
 
-		public T Clone<T>() where T: Entity
+		public Unit Clone()
 		{
-			return MongoHelper.FromBson<T>(MongoHelper.ToBson(this));
+			return MongoHelper.FromBson<Unit>(MongoHelper.ToBson(this));
 		}
 
 		public override void Dispose()
@@ -53,7 +53,7 @@ namespace Base
 		public K AddComponent<K>() where K : Component, new()
 		{
 			K component = (K) Activator.CreateInstance(typeof (K));
-			component.SetOwner(this);
+			component.Owner = this;
 
 			if (this.componentDict.ContainsKey(component.GetType()))
 			{
@@ -74,7 +74,7 @@ namespace Base
 		public K AddComponent<K, P1>(P1 p1) where K : Component, new()
 		{
 			K component = (K)Activator.CreateInstance(typeof(K));
-			component.SetOwner(this);
+			component.Owner = this;
 
 			if (this.componentDict.ContainsKey(component.GetType()))
 			{
@@ -95,7 +95,7 @@ namespace Base
 		public K AddComponent<K, P1, P2>(P1 p1, P2 p2) where K : Component, new()
 		{
 			K component = (K)Activator.CreateInstance(typeof(K));
-			component.SetOwner(this);
+			component.Owner = this;
 
 			if (this.componentDict.ContainsKey(component.GetType()))
 			{
@@ -117,7 +117,7 @@ namespace Base
 		public K AddComponent<K, P1, P2, P3>(P1 p1, P2 p2, P3 p3) where K : Component, new()
 		{
 			K component = (K)Activator.CreateInstance(typeof(K));
-			component.SetOwner(this);
+			component.Owner = this;
 
 			if (this.componentDict.ContainsKey(component.GetType()))
 			{
@@ -200,7 +200,7 @@ namespace Base
 			}
 			foreach (Component component in this.components)
 			{
-				component.SetOwner(this);
+				component.Owner = this;
 				this.componentDict.Add(component.GetType(), component);
 			}
 		}

+ 0 - 0
Unity/Assets/Scripts/Base/Object/Entity.cs.meta → Unity/Assets/Scripts/Base/Object/Unit.cs.meta


+ 90 - 0
Unity/Assets/Scripts/Component/ChildrenComponent.cs

@@ -0,0 +1,90 @@
+using System.Collections.Generic;
+using System.Linq;
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace Base
+{
+	/// <summary>
+	/// 父子层级信息
+	/// </summary>
+    public class ChildrenComponent: Component
+    {
+		[BsonIgnore]
+		public Unit Parent { get; private set; }
+		
+		private readonly Dictionary<long, Unit> idChildren = new Dictionary<long, Unit>();
+
+		[BsonIgnore]
+		public int Count
+		{
+			get
+			{
+				return this.idChildren.Count;
+			}
+		}
+
+		public void Add(Unit unit)
+		{
+			unit.GetComponent<ChildrenComponent>().Parent = this.Owner;
+			this.idChildren.Add(unit.Id, unit);
+		}
+
+		public Unit Get(long id)
+		{
+			Unit unit = null;
+			this.idChildren.TryGetValue(id, out unit);
+			return unit;
+		}
+
+		public Unit[] GetChildren()
+		{
+			return this.idChildren.Values.ToArray();
+		}
+
+		private void Remove(Unit unit)
+		{
+			this.idChildren.Remove(unit.Id);
+			unit.Dispose();
+		}
+
+		public void Remove(long id)
+		{
+			Unit unit;
+			if (!this.idChildren.TryGetValue(id, out unit))
+			{
+				return;
+			}
+			this.Remove(unit);
+		}
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+
+			foreach (Unit entity in this.idChildren.Values.ToArray())
+			{
+				entity.Dispose();
+			}
+
+			this.Parent?.GetComponent<ChildrenComponent>().Remove(this.Id);
+		}
+    }
+
+	public static partial class ChildrenHelper
+	{
+		public static void Add(this Unit unit, Unit child)
+		{
+			unit.GetComponent<ChildrenComponent>().Add(child);
+		}
+
+		public static void Remove(this Unit unit, long id)
+		{
+			unit.GetComponent<ChildrenComponent>().Remove(id);
+		}
+	}
+}

+ 0 - 0
Unity/Assets/Scripts/Component/Scene/ChildrenComponent.cs.meta → Unity/Assets/Scripts/Component/ChildrenComponent.cs.meta


+ 6 - 5
Unity/Assets/Scripts/Component/Game.cs

@@ -1,16 +1,17 @@
 namespace Base
 {
-	public sealed class Game: Entity
+	public sealed class Game
 	{
-		private static Scene game;
+		private static Unit game;
 
-		public static Scene Scene
+		public static Unit Scene
 		{
 			get
 			{
 				if (game == null)
 				{
-					game = new Scene("Game", SceneType.Game);
+					game = new Unit();
+					game.AddComponent<Scene>();
 				}
 				return game;
 			}
@@ -18,7 +19,7 @@
 
 		public static void Close()
 		{
-			Scene scene = game;
+			Unit scene = game;
 			game = null;
 			scene.Dispose();
 		}

+ 23 - 0
Unity/Assets/Scripts/Component/GameObjectComponent.cs

@@ -0,0 +1,23 @@
+using UnityEngine;
+
+namespace Base
+{
+	[ObjectEvent]
+	public class GameObjectComponentEvent : ObjectEvent<GameObjectComponent>, IAwake<GameObject>
+	{
+		public void Awake(GameObject gameObject)
+		{
+			this.GetValue().Awake(gameObject);
+		}
+	}
+
+	public class GameObjectComponent : Component
+    {
+		public GameObject GameObject { get; private set; }
+
+		public void Awake(GameObject gameObject)
+		{
+			this.GameObject = gameObject;
+		}
+    }
+}

+ 2 - 2
Unity/Assets/Scripts/Base/Object/IOpen.cs.meta → Unity/Assets/Scripts/Component/GameObjectComponent.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: b7b209d0f1ae7254b96627414271c48a
-timeCreated: 1474942922
+guid: b22c8ba7a4c107043b96baaec985d757
+timeCreated: 1475915396
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 0 - 18
Unity/Assets/Scripts/Component/KVComponent.cs

@@ -42,22 +42,4 @@ namespace Base
 			base.Dispose();
 		}
     }
-
-	public static class KVHelper
-	{
-		public static void KVAdd(this Entity entity, string key, object value)
-		{
-			entity.GetComponent<KVComponent>().Add(key, value);
-		}
-
-		public static void KVRemove(this Entity entity, string key)
-		{
-			entity.GetComponent<KVComponent>().Remove(key);
-		}
-
-		public static void KVGet<T>(this Entity entity, string key)
-		{
-			entity.GetComponent<KVComponent>().Get<T>(key);
-		}
-	}
 }

+ 0 - 37
Unity/Assets/Scripts/Component/Scene.cs

@@ -1,37 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Base
-{
-	public enum SceneType
-	{
-		Share,
-		Game,
-		Login,
-		Lobby,
-		Map,
-	}
-
-	public sealed class Scene: Entity
-	{
-		public string Name { get; }
-
-		public SceneType SceneType { get; }
-
-		public Scene(string name, SceneType sceneType)
-		{
-			this.Name = name;
-			this.SceneType = sceneType;
-		}
-
-		public override void Dispose()
-		{
-			if (this.Id == 0)
-			{
-				return;
-			}
-
-			base.Dispose();
-		}
-	}
-}

+ 0 - 102
Unity/Assets/Scripts/Component/Scene/ChildrenComponent.cs

@@ -1,102 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using MongoDB.Bson.Serialization.Attributes;
-
-namespace Base
-{
-	/// <summary>
-	/// 父子层级信息
-	/// </summary>
-    public class ChildrenComponent : Component
-    {
-		[BsonIgnore]
-		public Scene Parent { get; private set; }
-		
-		private readonly Dictionary<long, Scene> idChildren = new Dictionary<long, Scene>();
-		
-		private readonly Dictionary<string, Scene> nameChildren = new Dictionary<string, Scene>();
-
-		[BsonIgnore]
-		public int Count
-		{
-			get
-			{
-				return this.idChildren.Count;
-			}
-		}
-
-		public void Add(Scene scene)
-		{
-			scene.GetComponent<ChildrenComponent>().Parent = this.GetOwner<Scene>();
-			this.idChildren.Add(scene.Id, scene);
-			this.nameChildren.Add(scene.Name, scene);
-		}
-
-		public Scene[] GetChildren()
-		{
-			return this.idChildren.Values.ToArray();
-		}
-
-		private void Remove(Scene scene)
-		{
-			this.idChildren.Remove(scene.Id);
-			this.nameChildren.Remove(scene.Name);
-			scene.Dispose();
-		}
-
-		public void Remove(long id)
-		{
-			Scene scene;
-			if (!this.idChildren.TryGetValue(id, out scene))
-			{
-				return;
-			}
-			this.Remove(scene);
-		}
-
-		public void Remove(string name)
-		{
-			Scene scene;
-			if (!this.nameChildren.TryGetValue(name, out scene))
-			{
-				return;
-			}
-			this.Remove(scene);
-		}
-
-		public override void Dispose()
-		{
-			if (this.Id == 0)
-			{
-				return;
-			}
-
-			base.Dispose();
-
-			foreach (Scene scene in this.idChildren.Values.ToArray())
-			{
-				scene.Dispose();
-			}
-
-			this.Parent?.GetComponent<ChildrenComponent>().Remove(this.Id);
-		}
-    }
-
-	public static class LevelHelper
-	{
-		public static void Add(this Scene scene, Scene child)
-		{
-			scene.GetComponent<ChildrenComponent>().Add(child);
-		}
-
-		public static void Remove(this Scene scene, long id)
-		{
-			scene.GetComponent<ChildrenComponent>().Remove(id);
-		}
-
-		public static void Remove(this Scene scene, string name)
-		{
-			scene.GetComponent<ChildrenComponent>().Remove(name);
-		}
-	}
-}

+ 7 - 6
Unity/Assets/Scripts/Component/Scene/MessageComponent.cs

@@ -66,7 +66,7 @@ namespace Base
 					}
 
 					MessageAttribute messageAttribute = (MessageAttribute)attrs[0];
-					if (messageAttribute.SceneType != this.GetOwner<Scene>().SceneType)
+					if (messageAttribute.SceneType != this.GetComponent<Scene>().SceneType)
 					{
 						continue;
 					}
@@ -83,7 +83,7 @@ namespace Base
 			}
 		}
 
-		public void Register<T>(Action<Scene, T> action)
+		public void Register<T>(Action<Unit, T> action)
 		{
 			Opcode opcode = EnumHelper.FromString<Opcode>(typeof (T).Name);
 			if (!this.events.ContainsKey(opcode))
@@ -91,6 +91,7 @@ namespace Base
 				this.events.Add(opcode, new List<Action<byte[], int, int>>());
 			}
 			List<Action<byte[], int, int>> actions = this.events[opcode];
+
 			actions.Add((messageBytes, offset, count) =>
 			{
 				T t;
@@ -108,7 +109,7 @@ namespace Base
 					Log.Debug(MongoHelper.ToJson(t));
 				}
 
-				action(this.GetOwner<Scene>(), t);
+				action(this.Owner, t);
 			});
 		}
 
@@ -121,7 +122,7 @@ namespace Base
 		public void Close(NetChannelType channelType)
 		{
 			AChannel channel = this.GetChannel(channelType);
-			if (channel == null || channel.IsDisposed())
+			if (channel == null || channel.Id == 0)
 			{
 				return;
 			}
@@ -139,7 +140,7 @@ namespace Base
 
 		private void UpdateChannel(AChannel channel)
 		{
-			if (channel.IsDisposed())
+			if (channel.Id == 0)
 			{
 				return;
 			}
@@ -207,7 +208,7 @@ namespace Base
 			List<Action<byte[], int, int>> actions;
 			if (!this.events.TryGetValue(opcode, out actions))
 			{
-				if (this.GetOwner<Scene>().SceneType == SceneType.Game)
+				if (this.GetComponent<Scene>().SceneType == SceneType.Game)
 				{
 					Log.Error($"消息{opcode}没有处理");
 				}

+ 34 - 0
Unity/Assets/Scripts/Component/Scene/Scene.cs

@@ -0,0 +1,34 @@
+namespace Base
+{
+	public enum SceneType
+	{
+		Share,
+		Game,
+		Login,
+		Lobby,
+		Map,
+		Launcher,
+		Robot,
+		BehaviorTreeScene,
+		RobotClient,
+	}
+
+	public sealed class Scene : Component
+	{
+		public Scene Owner { get; set; }
+
+		public string Name { get; set; }
+
+		public SceneType SceneType { get; private set; }
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+		}
+	}
+}

+ 2 - 2
Unity/Assets/Scripts/Component/Scene.cs.meta → Unity/Assets/Scripts/Component/Scene/Scene.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: cb6e93c8091b5f447817c6debb98d5aa
-timeCreated: 1474943431
+guid: 73186e6a1c3318e4a95cc253c860e0af
+timeCreated: 1475915396
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 6 - 5
Unity/Assets/Scripts/Component/Share.cs

@@ -3,17 +3,18 @@
 	/// <summary>
 	/// 游戏和扩展编辑器都需要用到的数据放在这个Scene上面
 	/// </summary>
-	public sealed class Share : Entity
+	public sealed class Share
 	{
-		private static Scene share;
+		private static Unit share;
 
-		public static Scene Scene
+		public static Unit Scene
 		{
 			get
 			{
 				if (share == null)
 				{
-					share = new Scene("Share", SceneType.Share);
+					share = new Unit();
+					share.AddComponent<Scene>();
 					share.AddComponent<EventComponent>();
 					share.AddComponent<LogComponent>();
 					GlobalConfigComponent globalConfigComponent = share.AddComponent<GlobalConfigComponent>();
@@ -25,7 +26,7 @@
 
 		public static void Close()
 		{
-			Scene scene = share;
+			Unit scene = share;
 			share = null;
 			scene?.Dispose();
 		}

+ 9 - 0
Unity/Assets/Scripts/Component/UI.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: e86307745c67e5447bce24ec9c64397b
+folderAsset: yes
+timeCreated: 1475915395
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Unity/Assets/Scripts/Component/UI/UI.cs

@@ -0,0 +1,21 @@
+namespace Base
+{
+	public sealed class UI: Component
+	{
+		public Unit Scene { get; set; }
+
+		public UIType UIType { get; set; }
+
+		public string Name { get; }
+		
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+		}
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Component/UI/UI.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 1ac1cd316713406438a0a904d951035d
+timeCreated: 1475915395
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Unity/Assets/Scripts/Message/AMEvent.cs

@@ -7,6 +7,6 @@
 			component.Register<T>(Run);
 		}
 
-		public abstract void Run(Scene scene, T message);
+		public abstract void Run(Unit scene, T message);
 	}
 }

+ 98 - 0
Unity/Assets/Scripts/Other/UIType.cs

@@ -0,0 +1,98 @@
+namespace Base
+{
+	public enum UIType
+	{
+		None,
+		UIButton,
+		UILoading,
+		UISkillAndBuff,
+		UISmallMap,
+		UILifeBar,
+		UIHeroLifeBar,
+		UIOrtherUnitLifeBar,
+		UIWildLifeBar,
+		UIItemShop,
+		UIAttributeTips,
+		UINewLobby,
+		UISettingPanel,
+		UIActorDetailInfo,
+		UITopInfoPanel,
+		UITreasureChests,
+		UIStartGameLoading,
+		UIOtherUnitInfoPanel,
+		UILogin,
+		UIChat,
+		UIKillRadioHeadIcon,
+		UIKillRadio,
+		UITabPanel,
+		UIChannelBar,
+		UISignalPanel,
+		UIChooseHero,
+		UISettlement,
+		UIIconEffects,
+		UILauncher,
+		UIBuffTips,
+		UIHallTips,
+		UIGeneralTips,
+		UIReconnectGame,
+		UIFullScreenPanel,
+		UIDeathPlayback,
+		UINewLobbyTopPanel,
+		UINewLobbyBottomPanel,
+
+		UITeamInfoPanel,
+		UITeamInvitePanel,
+		UIAddFriendPanel,
+		UIInvitePanel,
+		UIMouseDist,
+		UITeamMenuPanel,
+		UILotteryPanel,
+		UIGMPanel,
+		UIItemTips,
+		UIStatistics,
+		UISystemNotice,
+		UISuperTaunt,
+		UISurrender,
+		UIRegister,
+		UINameSummoner,
+		UITaskPanel,
+		UITaskRewardPanel,
+		UIFriendsPanel,
+		UIFriendsAddGroupPanel,
+		UICommonMenuPanel,
+		UIFriendsModifyRemarksPanel,
+		UIFriendQueryPlayerPanel,
+		UIMessageCenterPanel,
+		UIMessagePopPanel,
+
+		// 二级UI
+		UIFriendInfoNode,
+		UIFriendInfoNodeContainer,
+		UIStatisticsPanel,
+		UITaskInfoItem,
+		UITaskRewardPanelItem,
+		UITeamMenuBtn,
+		UIChatText,
+		UIItemEffect,
+		UIWildUILifeBar,
+		UIOtherUnitUILifeBar,
+		UISoldierUILifeBar,
+		UIFactionTimeUILifeBar,
+		UIHeroUILifeBar,
+		UIBossUILifeBar,
+		UIFriendsMessage,
+		UISkill,
+		UIBuff,
+		UIKillInfo,
+		UIInviteFriendItem,
+		UINodeContainer,
+		UILoginNewsItem,
+		UIFriendInfoItem,
+		UIFriendOperateMenu,
+		UIFriendMenuGroupItem,
+		UIBlackNameItem,
+		UIRecentFriendItem,
+		UIMessageGroupItem,
+		UIMessageDetailItem
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Other/UIType.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 479c1a787b2701241930fa99fdc67183
+timeCreated: 1475915395
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Unity/Controller/Message/S2C_InitBuffInfoEvent.cs

@@ -5,7 +5,7 @@ namespace Controller
 	[Message(SceneType.Game)]
 	public class S2C_InitBuffInfoEvent: AMEvent<S2C_InitBuffInfo>
 	{
-		public override void Run(Scene scene, S2C_InitBuffInfo buffInfo)
+		public override void Run(Unit scene, S2C_InitBuffInfo buffInfo)
 		{
 			Log.Info(MongoHelper.ToJson(buffInfo));
 		}

+ 7 - 4
Unity/Unity.CSharp.csproj

@@ -119,10 +119,9 @@
     <Compile Include="Assets\Scripts\Base\Network\UNet\USocket.cs" />
     <Compile Include="Assets\Scripts\Base\Network\UNet\USocketManager.cs" />
     <Compile Include="Assets\Scripts\Base\Object\Component.cs" />
-    <Compile Include="Assets\Scripts\Base\Object\Entity.cs" />
+    <Compile Include="Assets\Scripts\Base\Object\Unit.cs" />
     <Compile Include="Assets\Scripts\Base\Object\IAwake.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ILoader.cs" />
-    <Compile Include="Assets\Scripts\Base\Object\IOpen.cs" />
     <Compile Include="Assets\Scripts\Base\Object\IStart.cs" />
     <Compile Include="Assets\Scripts\Base\Object\IUpdate.cs" />
     <Compile Include="Assets\Scripts\Base\Object\Object.cs" />
@@ -132,9 +131,11 @@
     <Compile Include="Assets\Scripts\Base\ReferenceCollector.cs" />
     <Compile Include="Assets\Scripts\Base\TryLocker.cs" />
     <Compile Include="Assets\Scripts\Component\Game.cs" />
+    <Compile Include="Assets\Scripts\Component\GameObjectComponent.cs" />
+    <Compile Include="Assets\Scripts\Component\Scene\Scene.cs" />
+    <Compile Include="Assets\Scripts\Component\UI\UI.cs" />
     <Compile Include="Assets\Scripts\Component\KVComponent.cs" />
-    <Compile Include="Assets\Scripts\Component\Scene\ChildrenComponent.cs" />
-    <Compile Include="Assets\Scripts\Component\Scene.cs" />
+    <Compile Include="Assets\Scripts\Component\ChildrenComponent.cs" />
     <Compile Include="Assets\Scripts\Component\Scene\EventComponent.cs" />
     <Compile Include="Assets\Scripts\Component\Scene\GlobalConfigComponent.cs" />
     <Compile Include="Assets\Scripts\Component\Scene\LogComponent.cs" />
@@ -162,10 +163,12 @@
     <Compile Include="Assets\Scripts\Other\EventIdType.cs" />
     <Compile Include="Assets\Scripts\Other\GameException.cs" />
     <Compile Include="Assets\Scripts\Other\IEvent.cs" />
+    <Compile Include="Assets\Scripts\Other\UIType.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="Assets\CSharp 6.0 Support\AsyncTools\Plugins\AsyncBridge.Net35.xml" />
     <None Include="Assets\CSharp 6.0 Support\AsyncTools\Plugins\System.Threading.xml" />
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2015\UnityVS.CSharp.targets" />
 </Project>