Просмотр исходного кода

重构行为树代码,这是一个长期的过程

tanghai 8 лет назад
Родитель
Сommit
27528d026c
100 измененных файлов с 135 добавлено и 5176 удалено
  1. 2 2
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorBatchOperation.cs
  2. 61 51
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorManager.cs
  3. 1 1
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorNodeConfigExtension.cs
  4. 3 3
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorNodeData.cs
  5. 1 1
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeConfigExtension.cs
  6. 3 3
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeNodeClassPopup.cs
  7. 2 2
      Unity/Assets/Editor/BehaviorTreeEditor/Component.meta
  8. 12 0
      Unity/Assets/Editor/BehaviorTreeEditor/Component/BehaviorTreeDebugComponent.cs
  9. 3 3
      Unity/Assets/Editor/BehaviorTreeEditor/Component/BehaviorTreeDebugComponent.cs.meta
  10. 4 3
      Unity/Assets/Editor/BehaviorTreeEditor/Event/BehaviorTreeRunTreeEvent_ShowDebugInfo.cs
  11. 14 14
      Unity/Assets/Editor/BehaviorTreeEditor/GraphDesigner.cs
  12. 1 1
      Unity/Assets/Editor/BehaviorTreeEditor/NodeDesigner.cs
  13. 6 16
      Unity/Assets/Editor/BehaviorTreeEditor/NodeMetaHelper.cs
  14. 0 0
      Unity/Assets/Editor/BehaviorTreeEditor/NodeMetaHelper.cs.meta
  15. 22 19
      Unity/Assets/Editor/BehaviorTreeEditor/PropertyDesigner.cs
  16. 0 9
      Unity/Assets/RedScarf/UnityEditorScript.meta
  17. 0 9
      Unity/Assets/RedScarf/UnityEditorScript/Editor.meta
  18. 0 9
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Demo.meta
  19. 0 95
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Demo/DemoWindow.cs
  20. 0 9
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display.meta
  21. 0 98
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Button.cs
  22. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Button.cs.meta
  23. 0 89
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ColorField.cs
  24. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ColorField.cs.meta
  25. 0 133
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/CurveField.cs
  26. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/CurveField.cs.meta
  27. 0 427
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DisplayObject.cs
  28. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DisplayObject.cs.meta
  29. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DoubleField.cs
  30. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DoubleField.cs.meta
  31. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskField.cs
  32. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskField.cs.meta
  33. 0 61
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskPopup.cs
  34. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskPopup.cs.meta
  35. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumPopup.cs
  36. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumPopup.cs.meta
  37. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/FloatField.cs
  38. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/FloatField.cs.meta
  39. 0 136
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Foldout.cs
  40. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Foldout.cs.meta
  41. 0 29
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HelpBox.cs
  42. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HelpBox.cs.meta
  43. 0 66
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HorizontalSlider.cs
  44. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HorizontalSlider.cs.meta
  45. 0 72
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/InspectorTitlebar.cs
  46. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/InspectorTitlebar.cs.meta
  47. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntField.cs
  48. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntField.cs.meta
  49. 0 186
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntPopup.cs
  50. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntPopup.cs.meta
  51. 0 120
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntSlider.cs
  52. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntSlider.cs.meta
  53. 0 123
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LabelField.cs
  54. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LabelField.cs.meta
  55. 0 104
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LayerField.cs
  56. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LayerField.cs.meta
  57. 0 128
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Line.cs
  58. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Line.cs.meta
  59. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LongField.cs
  60. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LongField.cs.meta
  61. 0 119
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/MaskField.cs
  62. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/MaskField.cs.meta
  63. 0 141
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ObjectField.cs
  64. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ObjectField.cs.meta
  65. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/PasswordField.cs
  66. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/PasswordField.cs.meta
  67. 0 143
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Popup.cs
  68. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Popup.cs.meta
  69. 0 40
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ProgressBar.cs
  70. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ProgressBar.cs.meta
  71. 0 69
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RectField.cs
  72. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RectField.cs.meta
  73. 0 108
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RepeatButton.cs
  74. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RepeatButton.cs.meta
  75. 0 102
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ScrollView.cs
  76. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ScrollView.cs.meta
  77. 0 59
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectableLabel.cs
  78. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectableLabel.cs.meta
  79. 0 121
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectionGrid.cs
  80. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectionGrid.cs.meta
  81. 0 93
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Stage.cs
  82. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Stage.cs.meta
  83. 0 104
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TagField.cs
  84. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TagField.cs.meta
  85. 0 58
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextArea.cs
  86. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextArea.cs.meta
  87. 0 105
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextField.cs
  88. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextField.cs.meta
  89. 0 101
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Texture.cs
  90. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Texture.cs.meta
  91. 0 104
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toggle.cs
  92. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toggle.cs.meta
  93. 0 100
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ToggleLeft.cs
  94. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ToggleLeft.cs.meta
  95. 0 114
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toolbar.cs
  96. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toolbar.cs.meta
  97. 0 197
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBezier.cs
  98. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBezier.cs.meta
  99. 0 61
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBoundsField.cs
  100. 0 12
      Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBoundsField.cs.meta

+ 2 - 2
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorBatchOperation.cs

@@ -12,7 +12,7 @@ namespace MyEditor
 		public delegate void ExcuteTreeOperate(BehaviorTreeConfig treeConfig, string treePath);
 
 		public static Dictionary<int, BehaviorTreeConfig> mId2TreeDict = new Dictionary<int, BehaviorTreeConfig>();
-		public static Dictionary<string, ClientNodeTypeProto> mCientNodeDict;
+		public static Dictionary<string, NodeMeta> mCientNodeDict;
 		public static Dictionary<string, bool> mUseNodeDict = new Dictionary<string, bool>();
 
 		public static void HasUseNode(NodeProto node, string treePath)
@@ -67,7 +67,7 @@ namespace MyEditor
 
 		public static bool HasNodeField(NodeProto node, Type searchType, string prefabPath)
 		{
-			FieldInfo[] fieldInfos = ExportNodeTypeConfig.GetFieldInfos(node.Name);
+			FieldInfo[] fieldInfos = NodeMetaHelper.GetFieldInfos(node.Name);
 			foreach (FieldInfo fieldInfo in fieldInfos)
 			{
 				if (fieldInfo.FieldType == searchType)

+ 61 - 51
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorManager.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Reflection;
 using Base;
 using Model;
@@ -10,17 +11,21 @@ using Object = UnityEngine.Object;
 
 namespace MyEditor
 {
-	public class BehaviorManager
+	public class BehaviorManager: Entity
 	{
-		public GameObject CurTreeGO { get; set; }
-		public BehaviorTreeData CurTree { get; set; }
+		private static BehaviorManager instance;
+
 		public const int NodeIdStartIndex = 100000;
 		private int AutoID = NodeIdStartIndex;
-		private Dictionary<string, ClientNodeTypeProto> name2NodeProtoDict = new Dictionary<string, ClientNodeTypeProto>(); //节点类型 name索引
-		public static List<List<long>> treePathList = new List<List<long>>();
+
+		public GameObject CurTreeGO { get; set; }
+		public BehaviorTreeData CurTree { get; set; }
+
+		private Dictionary<string, NodeMeta> name2NodeProtoDict = new Dictionary<string, NodeMeta>(); //节点类型 name索引
+		public Dictionary<string, List<NodeMeta>> Classify2NodeProtoList { get; private set; } = new Dictionary<string, List<NodeMeta>>();
+
 		public string selectNodeName;
 		public string selectNodeType;
-		public BehaviorTree CurBehaviorTree { get; set; }
 
 		public BehaviorTreeConfig BehaviorTreeConfig
 		{
@@ -30,38 +35,43 @@ namespace MyEditor
 			}
 		}
 
-		public static BehaviorManager Instance { get; } = new BehaviorManager();
-
-		public Dictionary<string, List<ClientNodeTypeProto>> Classify2NodeProtoList { get; private set; } =
-			new Dictionary<string, List<ClientNodeTypeProto>>();
-
-		public List<ClientNodeTypeProto> AllNodeProtoList
+		public static BehaviorManager Instance
 		{
 			get
 			{
-				List<ClientNodeTypeProto> list = new List<ClientNodeTypeProto>();
-				foreach (KeyValuePair<string, List<ClientNodeTypeProto>> item in Instance.Classify2NodeProtoList)
+				if (instance == null)
 				{
-					foreach (ClientNodeTypeProto proto in item.Value)
-					{
-						list.Add(proto);
-					}
+					instance = new BehaviorManager();
+					instance.AddComponent<BehaviorTreeDebugComponent>();
 				}
-				return list;
+				return instance;
 			}
 		}
 
-		//节点配置 get set
-		public ClientNodeTypeProto GetNodeTypeProto(string name)
+		public static void Reset()
 		{
-			ClientNodeTypeProto proto = ExportNodeTypeConfig.GetNodeTypeProtoFromDll(name);
-			return proto;
+			instance = null;
+		}
+
+		public NodeMeta GetNodeMeta(string nodeName)
+		{
+			NodeMeta nodeMeta = null;
+			this.name2NodeProtoDict.TryGetValue(nodeName, out nodeMeta);
+			return nodeMeta;
+		}
+
+		public List<NodeMeta> AllNodeProtoList
+		{
+			get
+			{
+				return name2NodeProtoDict.Values.ToList();
+			}
 		}
 
 		public void FilterClassify()
 		{
-			this.Classify2NodeProtoList = new Dictionary<string, List<ClientNodeTypeProto>>();
-			foreach (ClientNodeTypeProto nodeType in this.name2NodeProtoDict.Values)
+			this.Classify2NodeProtoList = new Dictionary<string, List<NodeMeta>>();
+			foreach (NodeMeta nodeType in this.name2NodeProtoDict.Values)
 			{
 				if (nodeType.isDeprecated)
 				{
@@ -74,7 +84,7 @@ namespace MyEditor
 				}
 				if (!this.Classify2NodeProtoList.ContainsKey(classify))
 				{
-					this.Classify2NodeProtoList.Add(classify, new List<ClientNodeTypeProto>());
+					this.Classify2NodeProtoList.Add(classify, new List<NodeMeta>());
 				}
 				this.Classify2NodeProtoList[classify].Add(nodeType);
 			}
@@ -94,7 +104,7 @@ namespace MyEditor
 
 		public void LoadNodeTypeProto()
 		{
-			this.name2NodeProtoDict = ExportNodeTypeConfig.ExportToDict();
+			this.name2NodeProtoDict = NodeMetaHelper.ExportToDict();
 		}
 
 		public void NewLoadPrefabTree()
@@ -109,12 +119,12 @@ namespace MyEditor
 			return tree;
 		}
 
-		public void printTree(BehaviorNodeData nodeData)
+		public void PrintTree(BehaviorNodeData nodeData)
 		{
-			Log.Info($"printTree  :  {nodeData.Id} {nodeData}");
+			Log.Info($"PrintTree  :  {nodeData.Id} {nodeData}");
 			foreach (BehaviorNodeData data in nodeData.children)
 			{
-				printTree(data);
+				this.PrintTree(data);
 			}
 		}
 
@@ -126,7 +136,7 @@ namespace MyEditor
 
 		public bool CheckNodeInput(NodeProto nodeProto)
 		{
-			List<NodeFieldDesc> list = ExportNodeTypeConfig.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeInputAttribute));
+			List<NodeFieldDesc> list = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeInputAttribute));
 			foreach (NodeFieldDesc desc in list)
 			{
 				List<string> canInputList = GetCanInPutEnvKeyList(this.NodeProtoToBehaviorNodeData(nodeProto), desc);
@@ -180,7 +190,7 @@ namespace MyEditor
 		
 		public void RemoveUnusedArgs(NodeProto nodeProto)
 		{
-			ClientNodeTypeProto proto = ExportNodeTypeConfig.GetNodeTypeProtoFromDll(nodeProto.Name);
+			NodeMeta proto = BehaviorManager.Instance.GetNodeMeta(nodeProto.Name);
 			List<string> unUsedList = new List<string>();
 			foreach (KeyValuePair<string, object> item in nodeProto.Args.Dict())
 			{
@@ -284,12 +294,12 @@ namespace MyEditor
 			List<string> unUseList = new List<string>();
 			foreach (KeyValuePair<string, object> args in nodeData.Args.Dict())
 			{
-				if (!ExportNodeTypeConfig.NodeHasField(nodeData.Name, args.Key))
+				if (!NodeMetaHelper.NodeHasField(nodeData.Name, args.Key))
 				{
 					unUseList.Add(args.Key);
 					continue;
 				}
-				Type originType = ExportNodeTypeConfig.GetFieldType(nodeData.Name, args.Key);
+				Type originType = NodeMetaHelper.GetFieldType(nodeData.Name, args.Key);
 				try
 				{
 					string fieldName = args.Key;
@@ -358,7 +368,7 @@ namespace MyEditor
 
 		//private List<NodeFieldDesc> GetFieldDescList(NodeProto nodeProto, Type type)
 		//{
-		//	List<NodeFieldDesc> list = ExportNodeTypeConfig.GetNodeFieldInOutPutDescList(nodeProto.name, type);
+		//	List<NodeFieldDesc> list = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.name, type);
 		//	foreach (NodeProto childProto in nodeProto.children)
 		//	{
 		//		list.AddRange(GetFieldDescList(childProto, type));
@@ -381,11 +391,13 @@ namespace MyEditor
 
 		public BehaviorNodeData CopyNode(BehaviorNodeData node)
 		{
-			BehaviorNodeData copyNode = new BehaviorNodeData();
-			copyNode.Name = node.Name;
-			copyNode.Desc = node.Desc;
-			copyNode.Pos = node.Pos;
-			copyNode.Args = node.Args.Clone();
+			BehaviorNodeData copyNode = new BehaviorNodeData
+			{
+				Name = node.Name,
+				Desc = node.Desc,
+				Pos = node.Pos,
+				Args = node.Args.Clone()
+			};
 			List<BehaviorNodeData> list = new List<BehaviorNodeData>();
 			foreach (BehaviorNodeData item in node.children)
 			{
@@ -472,11 +484,11 @@ namespace MyEditor
 
 			if (desc == null)
 			{
-				list = ExportNodeTypeConfig.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeOutputAttribute));
+				list = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeOutputAttribute));
 			}
 			else
 			{
-				list = ExportNodeTypeConfig.GetNodeFieldInOutPutFilterDescList(nodeProto.Name, typeof(NodeOutputAttribute), desc.envKeyType);
+				list = NodeMetaHelper.GetNodeFieldInOutPutFilterDescList(nodeProto.Name, typeof(NodeOutputAttribute), desc.envKeyType);
 			}
 			for (int i = 0; i < list.Count; i++)
 			{
@@ -494,7 +506,7 @@ namespace MyEditor
 		public List<string> GetSelectNodeInputValueList(NodeProto nodeProto)
 		{
 			List<string> resultList = new List<string>();
-			List<NodeFieldDesc> list = ExportNodeTypeConfig.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeInputAttribute));
+			List<NodeFieldDesc> list = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeInputAttribute));
 
 			foreach (NodeFieldDesc desc in list)
 			{
@@ -515,7 +527,7 @@ namespace MyEditor
 		public bool IsHighLight(BehaviorNodeData node)
 		{
 			NodeProto nodeProto = this.BehaviorNodeDataToNodeProto(node);
-			List<NodeFieldDesc> list = ExportNodeTypeConfig.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeOutputAttribute));
+			List<NodeFieldDesc> list = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeOutputAttribute));
 			foreach (NodeFieldDesc desc in list)
 			{
 				if (!nodeProto.Args.ContainsKey(desc.name))
@@ -532,18 +544,17 @@ namespace MyEditor
 			return false;
 		}
 
-		public void SetDebugState(BehaviorTree tree, List<long> pathList)
+		public void SetDebugState(List<long> pathList)
 		{
-			CurBehaviorTree = tree;
 			foreach (long nodeId in pathList)
 			{
-				Instance.SetDebugState(tree, (int) nodeId);
+				Instance.SetDebugState((int) nodeId);
 			}
 		}
 
-		private void SetDebugState(BehaviorTree tree, int nodeId)
+		private void SetDebugState(int nodeId)
 		{
-			if (this.BehaviorTreeConfig != null && tree.behaviorTreeConfig.gameObject.name == this.BehaviorTreeConfig.gameObject.name)
+			if (this.BehaviorTreeConfig != null)
 			{
 				BehaviorNodeData nodeData = GetNodeData(CurTree.Root, nodeId);
 				if (nodeData != null)
@@ -600,8 +611,7 @@ namespace MyEditor
 
 		public void Clear()
 		{
-			treePathList.Clear();
-			CurBehaviorTree = null;
+			instance = null;
 		}
 	}
 }

+ 1 - 1
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorNodeConfigExtension.cs

@@ -18,7 +18,7 @@ namespace Model
 			nodeConfig.describe = nodeData.Desc;
 			foreach (KeyValuePair<string, object> args in nodeData.Args.Dict())
 			{
-				Type originType = ExportNodeTypeConfig.GetFieldType(nodeData.Name, args.Key);
+				Type originType = NodeMetaHelper.GetFieldType(nodeData.Name, args.Key);
 				try
 				{
 					string fieldName = args.Key;

+ 3 - 3
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorNodeData.cs

@@ -36,7 +36,7 @@ namespace MyEditor
 		public DebugState NodeDeubgState { get; set; }
 		public string time;
 
-		public ClientNodeTypeProto Proto { get; set; }
+		public NodeMeta Proto { get; set; }
 
 		public List<BehaviorNodeData> Children
 		{
@@ -53,10 +53,10 @@ namespace MyEditor
 		public BehaviorNodeData(string proto_name)
 		{
 			this.Name = proto_name;
-			this.Proto = BehaviorManager.Instance.GetNodeTypeProto(proto_name);
+			this.Proto = BehaviorManager.Instance.GetNodeMeta(proto_name);
 			if (this.Proto == null)
 			{
-				this.Proto = BehaviorManager.Instance.GetNodeTypeProto("Unknow");
+				this.Proto = BehaviorManager.Instance.GetNodeMeta("Unknow");
 				return;
 			}
 			this.Classify = this.Proto.classify;

+ 1 - 1
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeConfigExtension.cs

@@ -33,7 +33,7 @@ namespace Model
 
 		private static BehaviorNodeConfig CreateNodeConfig(this BehaviorTreeConfig treeConfig, string name)
 		{
-			ClientNodeTypeProto proto = ExportNodeTypeConfig.GetNodeTypeProtoFromDll(name);
+			NodeMeta proto = BehaviorManager.Instance.GetNodeMeta(name);
 			GameObject go = new GameObject();
 			go.name = name;
 			go.transform.parent = treeConfig.gameObject.transform;

+ 3 - 3
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeNodeClassPopup.cs

@@ -68,7 +68,7 @@ namespace MyEditor
 
 			foreach (string name in nodeNameList)
 			{
-				ClientNodeTypeProto proto = ExportNodeTypeConfig.GetNodeTypeProtoFromDll(name);
+				NodeMeta proto = BehaviorManager.Instance.GetNodeMeta(name);
 				if (GUILayout.Button(name + $"({proto.describe})", GetButtonStyle()))
 				{
 					if (SubWinType.CreateNode == mSubWinType)
@@ -109,7 +109,7 @@ namespace MyEditor
 				selectType = Enum.GetName(typeof(NodeClassifyType), mEnumNodeTypeSelection - 1);
 				foreach (string name in list)
 				{
-					ClientNodeTypeProto proto = ExportNodeTypeConfig.GetNodeTypeProtoFromDll(name);
+					NodeMeta proto = BehaviorManager.Instance.GetNodeMeta(name);
 					if (selectType == proto.classify)
 					{
 						result1.Add(name);
@@ -125,7 +125,7 @@ namespace MyEditor
 			List<string> result2 = new List<string>();
 			foreach (string name in result1)
 			{
-				ClientNodeTypeProto proto = ExportNodeTypeConfig.GetNodeTypeProtoFromDll(name);
+				NodeMeta proto = BehaviorManager.Instance.GetNodeMeta(name);
 				if (name.ToUpper().Contains(text.ToUpper()) || proto.describe.ToUpper().Contains(text.ToUpper()))
 				{
 					result2.Add(name);

+ 2 - 2
Unity/Assets/RedScarf.meta → Unity/Assets/Editor/BehaviorTreeEditor/Component.meta

@@ -1,7 +1,7 @@
 fileFormatVersion: 2
-guid: 3dc598035dd0e374d8d2041fb4b6ad18
+guid: fb890a127a2337a4b98f94eb9c8d3dd1
 folderAsset: yes
-timeCreated: 1497865596
+timeCreated: 1498010502
 licenseType: Free
 DefaultImporter:
   userData: 

+ 12 - 0
Unity/Assets/Editor/BehaviorTreeEditor/Component/BehaviorTreeDebugComponent.cs

@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+using Model;
+
+namespace MyEditor
+{
+	public class BehaviorTreeDebugComponent: Component
+	{
+		public List<List<long>> TreePathList = new List<List<long>>();
+
+		public BehaviorTree BehaviorTree { get; set; }
+	}
+}

+ 3 - 3
Unity/Assets/RedScarf/UnityEditorScript/Editor/Demo/DemoWindow.cs.meta → Unity/Assets/Editor/BehaviorTreeEditor/Component/BehaviorTreeDebugComponent.cs.meta

@@ -1,7 +1,7 @@
 fileFormatVersion: 2
-guid: 74c50d7761548bc48b40740a3ced6996
-timeCreated: 1494560573
-licenseType: Pro
+guid: 5acddc11f00846b4c9fee8d284f7d002
+timeCreated: 1498010502
+licenseType: Free
 MonoImporter:
   serializedVersion: 2
   defaultReferences: []

+ 4 - 3
Unity/Assets/Editor/BehaviorTreeEditor/Event/BehaviorTreeRunTreeEvent_ShowDebugInfo.cs

@@ -8,11 +8,12 @@ namespace MyEditor
 	{
 		public void Run(BehaviorTree tree, List<long> pathList)
 		{
-			if (BehaviorManager.Instance.BehaviorTreeConfig != null && tree.behaviorTreeConfig.name == BehaviorManager.Instance.BehaviorTreeConfig.name)
+			if (BehaviorManager.Instance.BehaviorTreeConfig != null)
 			{
-				BehaviorManager.treePathList.Add(pathList);
 				BehaviorManager.Instance.ClearDebugState();
-				BehaviorManager.Instance.SetDebugState(tree, pathList);
+				BehaviorManager.Instance.GetComponent<BehaviorTreeDebugComponent>().TreePathList.Add(pathList);
+				BehaviorManager.Instance.GetComponent<BehaviorTreeDebugComponent>().BehaviorTree = tree;
+				BehaviorManager.Instance.SetDebugState(pathList);
 			}
 		}
 	}

+ 14 - 14
Unity/Assets/Editor/BehaviorTreeEditor/GraphDesigner.cs

@@ -330,8 +330,8 @@ namespace MyEditor
 				if (mSelectedNode.NodeData.Proto.classify == NodeClassifyType.Root.ToString() ||
 				    BehaviorManager.Instance.CurTree.Root.Id == mSelectedNode.NodeData.Id)
 				{
-					List<ClientNodeTypeProto> list = BehaviorManager.Instance.Classify2NodeProtoList[NodeClassifyType.Root.ToString()];
-					foreach (ClientNodeTypeProto nodeType in list)
+					List<NodeMeta> list = BehaviorManager.Instance.Classify2NodeProtoList[NodeClassifyType.Root.ToString()];
+					foreach (NodeMeta nodeType in list)
 					{
 						result.Add(nodeType.name);
 						// menu.AddItem(new GUIContent(string.Format("{0}/{1}", "替换为", nodeType.name)), false, new GenericMenu.MenuFunction2(this.ChangeNodeType), nodeType.name);
@@ -340,9 +340,9 @@ namespace MyEditor
 				else
 				{
 					// NodeChildLimitType nodeChildLimitType = mSelectedNode.NodeData.IsLeaf() ? NodeChildLimitType.All : NodeChildLimitType.WithChild;
-					List<ClientNodeTypeProto> canSubtituteList = BehaviorManager.Instance.AllNodeProtoList;
+					List<NodeMeta> canSubtituteList = BehaviorManager.Instance.AllNodeProtoList;
 					canSubtituteList.Sort(CompareShowName);
-					foreach (ClientNodeTypeProto nodeType in canSubtituteList)
+					foreach (NodeMeta nodeType in canSubtituteList)
 					{
 						if (nodeType.classify == NodeClassifyType.Root.ToString())
 						{
@@ -363,16 +363,16 @@ namespace MyEditor
 		{
 			List<string> result = new List<string>();
 
-			foreach (KeyValuePair<string, List<ClientNodeTypeProto>> kv in BehaviorManager.Instance.Classify2NodeProtoList)
+			foreach (KeyValuePair<string, List<NodeMeta>> kv in BehaviorManager.Instance.Classify2NodeProtoList)
 			{
 				string classify = kv.Key;
-				List<ClientNodeTypeProto> nodeProtoList = kv.Value;
+				List<NodeMeta> nodeProtoList = kv.Value;
 				nodeProtoList.Sort(CompareShowName);
 				if (classify == NodeClassifyType.Root.ToString())
 				{
 					continue;
 				}
-				foreach (ClientNodeTypeProto node in nodeProtoList)
+				foreach (NodeMeta node in nodeProtoList)
 				{
 					if (mSelectedNode != null && mSelectedNode.NodeData.Children.Count < mSelectedNode.NodeData.Proto.child_limit)
 					{
@@ -418,7 +418,7 @@ namespace MyEditor
 				{
 					string menuName = string.Format($"替换成{selectNodeName}");
 					NodeClassifyType value = (NodeClassifyType) Enum.Parse(typeof(NodeClassifyType), selectNodeType);
-					int count = ExportNodeTypeConfig.NodeTypeCountDict[value];
+					int count = NodeMetaHelper.NodeTypeCountDict[value];
 					if (selectNodeType == NodeClassifyType.Root.ToString() || (count == 0 && mSelectedNode.NodeData.Proto.child_limit > 0))
 					{
 						menu.AddDisabledItem(new GUIContent(menuName));
@@ -452,13 +452,13 @@ namespace MyEditor
 			BehaviorDesignerWindow.Instance.ShowSubWin(mMousePos, SubWinType.ReplaceNode);
 		}
 
-		private static int CompareShowName(ClientNodeTypeProto clientNodeType1, ClientNodeTypeProto clientNodeType2)
+		private static int CompareShowName(NodeMeta nodeType1, NodeMeta nodeType2)
 		{
-			if (string.IsNullOrEmpty(clientNodeType1.name) || string.IsNullOrEmpty(clientNodeType2.name))
+			if (string.IsNullOrEmpty(nodeType1.name) || string.IsNullOrEmpty(nodeType2.name))
 			{
 				Log.Error("字符串输入参数有误");
 			}
-			return String.CompareOrdinal(clientNodeType1.name, clientNodeType2.name);
+			return String.CompareOrdinal(nodeType1.name, nodeType2.name);
 		}
 
 		public void AutoSort()
@@ -468,7 +468,7 @@ namespace MyEditor
 		
 		private void CreateNode()
 		{
-			ClientNodeTypeProto nodeProto = BehaviorManager.Instance.GetNodeTypeProto(BehaviorManager.Instance.selectNodeName);
+			NodeMeta nodeProto = BehaviorManager.Instance.GetNodeMeta(BehaviorManager.Instance.selectNodeName);
 			BehaviorNodeData nodeData = BehaviorManager.Instance.CreateNode((int) BehaviorManager.Instance.CurTree.Id, nodeProto.name);
 			CreateNode(nodeData, MousePosToGraphPos(mMousePos));
 		}
@@ -550,7 +550,7 @@ namespace MyEditor
 		private void ChangeNodeType(object obj)
 		{
 			string nodeType = (string) obj;
-			ClientNodeTypeProto nodeProto = BehaviorManager.Instance.GetNodeTypeProto(nodeType);
+			NodeMeta nodeProto = BehaviorManager.Instance.GetNodeMeta(nodeType);
 			BehaviorNodeData nodeData = BehaviorManager.Instance.CreateNode((int) BehaviorManager.Instance.CurTree.Id, nodeProto.name);
 			NodeDesigner oldNode = mSelectedNode;
 			NodeDesigner newNode = new NodeDesigner(nodeData);
@@ -637,7 +637,7 @@ namespace MyEditor
 			string name = (string) list[0];
 			Vector2 pos = (Vector2) list[1];
 
-			ClientNodeTypeProto nodeProto = BehaviorManager.Instance.GetNodeTypeProto(name);
+			NodeMeta nodeProto = BehaviorManager.Instance.GetNodeMeta(name);
 			BehaviorNodeData nodeData = BehaviorManager.Instance.CreateNode((int) BehaviorManager.Instance.CurTree.Id, nodeProto.name);
 			CreateNode(nodeData, pos);
 		}

+ 1 - 1
Unity/Assets/Editor/BehaviorTreeEditor/NodeDesigner.cs

@@ -91,7 +91,7 @@ namespace MyEditor
 
 		public void Init()
 		{
-			NodeData.Proto = BehaviorManager.Instance.GetNodeTypeProto(NodeData.Name);
+			NodeData.Proto = BehaviorManager.Instance.GetNodeMeta(NodeData.Name);
 			string[] arr = NodeData.Proto.style.Split('/');
 			string style = arr.Length > 0? arr[0] : "";
 			if (style == "")

+ 6 - 16
Unity/Assets/Editor/BehaviorTreeEditor/ExportNodeTypeConfig.cs → Unity/Assets/Editor/BehaviorTreeEditor/NodeMetaHelper.cs

@@ -15,7 +15,7 @@ namespace MyEditor
 		All
 	}
 
-	public static class ExportNodeTypeConfig
+	public static class NodeMetaHelper
 	{
 		public static Dictionary<NodeClassifyType, int> NodeTypeCountDict { get; } = new Dictionary<NodeClassifyType, int>
 		{
@@ -27,13 +27,13 @@ namespace MyEditor
 			{ NodeClassifyType.DataTransform, 0 }
 		};
 
-		public static Dictionary<string, ClientNodeTypeProto> ExportToDict()
+		public static Dictionary<string, NodeMeta> ExportToDict()
 		{
-			Dictionary<string, ClientNodeTypeProto> name2NodeProtoDict = new Dictionary<string, ClientNodeTypeProto>();
+			Dictionary<string, NodeMeta> name2NodeProtoDict = new Dictionary<string, NodeMeta>();
 			Type[] types = DllHelper.GetMonoTypes();
 			foreach (Type type in types)
 			{
-				ClientNodeTypeProto proto = GetNodeTypeProtoFromType(type);
+				NodeMeta proto = GetNodeTypeProtoFromType(type);
 				if (proto == null)
 				{
 					continue;
@@ -48,17 +48,7 @@ namespace MyEditor
 			return Game.EntityEventManager.GetAssembly("Model");
 		}
 
-		public static ClientNodeTypeProto GetNodeTypeProtoFromDll(string name)
-		{
-			Type type = GetNodeType(name);
-			if (type == null)
-			{
-				Log.Error($"不存在类型type:{name}");
-			}
-			return GetNodeTypeProtoFromType(type);
-		}
-
-		public static ClientNodeTypeProto GetNodeTypeProtoFromType(Type type)
+		public static NodeMeta GetNodeTypeProtoFromType(Type type)
 		{
 			object[] nodeAttrs = type.GetCustomAttributes(typeof(NodeAttribute), false);
 			if (nodeAttrs.Length == 0)
@@ -73,7 +63,7 @@ namespace MyEditor
 				nodeDeprecatedAttribute = nodeDeprecatedAttrs[0] as NodeDeprecatedAttribute;
 			}
 
-			ClientNodeTypeProto proto = new ClientNodeTypeProto();
+			NodeMeta proto = new NodeMeta();
 			proto.type = nodeAttribute.ClassifytType.ToString();
 			proto.name = type.Name;
 			proto.describe = nodeAttribute.Desc;

+ 0 - 0
Unity/Assets/Editor/BehaviorTreeEditor/ExportNodeTypeConfig.cs.meta → Unity/Assets/Editor/BehaviorTreeEditor/NodeMetaHelper.cs.meta


+ 22 - 19
Unity/Assets/Editor/BehaviorTreeEditor/PropertyDesigner.cs

@@ -114,15 +114,15 @@ namespace MyEditor
 			mNodeFoldout = new FoldoutFolder("所有节点", SelectNodeFolderCallback);
 			mNodeFoldout.Fold = true;
 
-			foreach (KeyValuePair<string, List<ClientNodeTypeProto>> kv in BehaviorManager.Instance.Classify2NodeProtoList)
+			foreach (KeyValuePair<string, List<NodeMeta>> kv in BehaviorManager.Instance.Classify2NodeProtoList)
 			{
 				string classify = kv.Key;
-				List<ClientNodeTypeProto> nodeTypeList = kv.Value;
+				List<NodeMeta> nodeTypeList = kv.Value;
 				FoldoutFolder folder = mNodeFoldout.AddFolder(classify, SelectNodeFolderCallback);
 				folder.Fold = true;
 
 				mNodeCount++;
-				foreach (ClientNodeTypeProto nodeType in nodeTypeList)
+				foreach (NodeMeta nodeType in nodeTypeList)
 				{
 					folder.AddNode(classify, nodeType.name + " (" + nodeType.describe + ")", SelectNodeCallback);
 					mNodeCount++;
@@ -223,7 +223,7 @@ namespace MyEditor
 				{
 					BehaviorManager.Instance.SaveAll();
 				}
-				ClientNodeTypeProto node = BehaviorManager.Instance.GetNodeTypeProto(name);
+				NodeMeta node = BehaviorManager.Instance.GetNodeMeta(name);
 				GUILayout.Label("节点名:" + node.name);
 				GUILayout.Label("描述:" + node.describe);
 			}
@@ -326,7 +326,7 @@ namespace MyEditor
 			{
 				BehaviorManager.Instance.SaveAll();
 			}
-			ClientNodeTypeProto proto = mCurBehaviorNode.Proto;
+			NodeMeta proto = mCurBehaviorNode.Proto;
 			GUILayout.Space(10f);
 			GUILayout.Label("节点ID:" + mCurBehaviorNode.Id);
 			GUILayout.Label("节点名:" + mCurBehaviorNode.Name);
@@ -342,7 +342,7 @@ namespace MyEditor
 		private bool mFoldInput = true;
 		private bool mFoldOutput = true;
 
-		private void DrawAllValue(ClientNodeTypeProto proto)
+		private void DrawAllValue(NodeMeta proto)
 		{
 			List<NodeFieldDesc> paramFieldList = GetFieldDescList(proto.new_args_desc, typeof(NodeFieldAttribute));
 			List<NodeFieldDesc> inputFieldList = GetFieldDescList(proto.new_args_desc, typeof(NodeInputAttribute));
@@ -382,8 +382,8 @@ namespace MyEditor
 			for (int i = 0; i < fieldList.Count; i++)
 			{
 				NodeFieldDesc desc = fieldList[i];
-				Type fieldType = ExportNodeTypeConfig.GetFieldType(nodeName, desc.name);
-				ClientNodeTypeProto clientNode = ExportNodeTypeConfig.GetNodeTypeProtoFromDll(nodeName);
+				Type fieldType = NodeMetaHelper.GetFieldType(nodeName, desc.name);
+				NodeMeta nodeMeta = BehaviorManager.Instance.GetNodeMeta(nodeName);
 
 				// 如果不存在这个参数,给一个默认的
 				if (!mCurBehaviorNode.Args.ContainsKey(desc.name))
@@ -399,7 +399,7 @@ namespace MyEditor
 					{
 						newValue = InputEnumFieldValue(desc);
 					}
-					else if (nodeParamType == NodeParamType.Output && clientNode.classify == NodeClassifyType.Root.ToString())
+					else if (nodeParamType == NodeParamType.Output && nodeMeta.classify == NodeClassifyType.Root.ToString())
 					{
 						newValue = ConstTextFieldValue(desc);
 					}
@@ -605,14 +605,14 @@ namespace MyEditor
 			string[] enumValueArr;
 			if (mCurBehaviorNode.IsRoot() && desc.value.ToString() != BTEnvKey.None)
 			{
-				enumValueArr = new string[1] { desc.value.ToString() };
+				enumValueArr = new string[] { desc.value.ToString() };
 			}
 			else
 			{
 				enumValueArr = BehaviorTreeInOutConstrain.GetEnvKeyEnum(typeof(BTEnvKey));
 				if (enumValueArr.Length == 0)
 				{
-					enumValueArr = new string[1] { BTEnvKey.None };
+					enumValueArr = new string[] { BTEnvKey.None };
 				}
 				if (oldValue == BTEnvKey.None)
 				{
@@ -705,26 +705,29 @@ namespace MyEditor
 
 		public void DrawDebugView()
 		{
-			if (BehaviorManager.Instance.CurBehaviorTree == null)
+			BehaviorTree behaviorTree = BehaviorManager.Instance.GetComponent<BehaviorTreeDebugComponent>().BehaviorTree;
+			List<List<long>> treePathList = BehaviorManager.Instance.GetComponent<BehaviorTreeDebugComponent>().TreePathList;
+			if (behaviorTree == null)
 			{
 				return;
 			}
-			if (GUILayout.Button($"清空执行记录"))
+			if (GUILayout.Button("清空执行记录"))
 			{
-				BehaviorManager.treePathList.Clear();
+				treePathList.Clear();
 				BehaviorManager.Instance.ClearDebugState();
 			}
-			float offset = 55f;
+			const float offset = 55f;
 			GUILayout.BeginArea(new Rect(0f, 20f, this.mWidth, Screen.height - offset));
-			this.mTreeScrollPos = GUI.BeginScrollView(new Rect(0f, 0f, this.mWidth, Screen.height - offset), this.mTreeScrollPos,
-			                                          new Rect(0f, 0f, this.mWidth - 20f, BehaviorManager.treePathList.Count * 22), false, false);
+			this.mTreeScrollPos = GUI.BeginScrollView(
+				new Rect(0f, 0f, this.mWidth, Screen.height - offset), this.mTreeScrollPos,
+			    new Rect(0f, 0f, this.mWidth - 20f, treePathList.Count * 22), false, false);
 
-			for (int i = 0; i < BehaviorManager.treePathList.Count; i++)
+			for (int i = 0; i < BehaviorManager.Instance.GetComponent<BehaviorTreeDebugComponent>().TreePathList.Count; i++)
 			{
 				if (GUILayout.Button($"frame{i}"))
 				{
 					BehaviorManager.Instance.ClearDebugState();
-					BehaviorManager.Instance.SetDebugState(BehaviorManager.Instance.CurBehaviorTree, BehaviorManager.treePathList[i]);
+					BehaviorManager.Instance.SetDebugState(treePathList[i]);
 				}
 			}
 			GUI.EndScrollView();

+ 0 - 9
Unity/Assets/RedScarf/UnityEditorScript.meta

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

+ 0 - 9
Unity/Assets/RedScarf/UnityEditorScript/Editor.meta

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

+ 0 - 9
Unity/Assets/RedScarf/UnityEditorScript/Editor/Demo.meta

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

+ 0 - 95
Unity/Assets/RedScarf/UnityEditorScript/Editor/Demo/DemoWindow.cs

@@ -1,95 +0,0 @@
-using UnityEngine;
-using System.Collections;
-using UnityEditor;
-using System;
-
-/// <summary>
-/// 范例,脚本必须位于Editor文件夹下,继承自UESWindow
-/// </summary>
-public class UESDemoWindow : UESWindow
-{
-    /// <summary>
-    /// 此处打开面板
-    /// </summary>
-    [MenuItem("Tools/UnityEditorScript/Demo")]
-    static void Init()
-    {
-        var window = EditorWindow.GetWindow<UESDemoWindow>();
-        window.titleContent = new GUIContent("Demo Window");
-        window.Show();
-    }
-
-    UESBox box;
-
-    /// <summary>
-    /// 创建对象
-    /// </summary>
-    protected override void Awake()
-    {
-        base.Awake();                                                   //必须
-
-        box = UESTool.Create<UESBox>(this);                             //使用UESTool.Create<T>()创建对象
-        box.Rect = new Rect(100,100,100,100);
-        box.Mask = new Rect(-20, -20, 220, 300);                        //可以添加一个遮罩
-        stage.AddChild(box);                                            //添加对象到舞台
-        box.Text = "click!";
-
-        var helpBox = UESTool.Create<UESHelpBox>(this);
-        helpBox.Position = new Vector2(100, 100);                       //可以只设置位置,使用默认的尺寸
-        helpBox.SetDrawingStyle("drag!");
-        box.AddChild(helpBox);
-
-        var toolBar = UESTool.Create<UESToolbar>(this);
-        stage.AddChild(toolBar);
-        //单个物体添加监听
-        toolBar.AddEventListener(UESMouseEvent.MOUSE_CLICK, OnToolBarMouseClick);
-
-        //也可以给舞台添加鼠标监听
-        stage.AddEventListener(UESMouseEvent.MOUSE_CLICK, OnMouseClick);
-        stage.AddEventListener(UESMouseEvent.MOUSE_DOWN, OnMouseDown);
-        stage.AddEventListener(UESMouseEvent.MOUSE_UP, OnMouseUp);
-
-        //添加键盘监听
-        stage.AddEventListener(UESKeyboardEvent.KEY_UP, OnKeyUp);
-
-        //添加一个计时器
-        var timer = UESTool.Create<UESTimer>(this);
-        timer.Init(1000);
-        timer.Start();
-        timer.AddEventListener(UESTimerEvent.TIMER, OnTimer);
-    }
-
-    private void OnTimer(UESEvent obj)
-    {
-        Debug.Log("1sec...");
-        box.Size *= 1.1f;
-    }
-
-    private void OnKeyUp(UESEvent obj)
-    {
-        Debug.Log(obj.CurrentEvent.keyCode);
-    }
-
-    private void OnToolBarMouseClick(UESEvent obj)
-    {
-        Debug.Log("ToolBar selected is "+(obj.CurrentTarget as UESToolbar).Selected);
-    }
-
-    private void OnMouseUp(UESEvent obj)
-    {
-        var display = obj.Target as UESDisplayObject;
-        display.StopDrag();
-    }
-
-    private void OnMouseDown(UESEvent obj)
-    {
-        var display = obj.Target as UESDisplayObject;
-        display.StartDrag();
-    }
-
-    private void OnMouseClick(UESEvent obj)
-    {
-        var display = obj.Target as UESDisplayObject;
-        display.Rect = new Rect(display.Rect.position, display.Rect.size*1.1f);
-    }
-}

+ 0 - 9
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display.meta

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

+ 0 - 98
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Button.cs

@@ -1,98 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEditor;
-
-/// <summary>
-/// 按钮
-/// </summary>
-public class UESButton : UESDisplayObject
-{
-    protected string m_Text;
-    protected GUIContent m_Content;
-    protected Texture m_Image;
-    protected GUIStyle m_Style;
-    protected int drawingStyle;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("Button");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                GUI.Button(m_DrawingRect, m_Content);
-                break;
-
-            case 2:
-                GUI.Button(m_DrawingRect, m_Text);
-                break;
-
-            case 3:
-                GUI.Button(m_DrawingRect, m_Image);
-                break;
-
-            case 4:
-                GUI.Button(m_DrawingRect, m_Content, m_Style);
-                break;
-
-            case 5:
-                GUI.Button(m_DrawingRect, m_Text, m_Style);
-                break;
-
-            case 6:
-                GUI.Button(m_DrawingRect, m_Image, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent content)
-    {
-        drawingStyle = 1;
-
-        m_Content = content;
-    }
-
-    public void SetDrawingStyle(string text)
-    {
-        drawingStyle = 2;
-
-        m_Text = text;
-    }
-
-    public void SetDrawingStyle(Texture image)
-    {
-        drawingStyle = 3;
-
-        m_Image = image;
-    }
-
-    public void SetDrawingStyle(GUIContent content, GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_Content = content;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string text, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Text = text;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(Texture image, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_Image = image;
-        m_Style = style;
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Button.cs.meta

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

+ 0 - 89
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ColorField.cs

@@ -1,89 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-using UnityEditor.UI;
-
-public class UESColorField : UESDisplayObject
-{
-    protected Color m_Color;
-    protected int drawingStyle;
-    protected bool m_ShowEyedropper;
-    protected bool m_ShowAlpha;
-    protected bool m_Hdr;
-    protected ColorPickerHDRConfig m_ColorPickerHDRConfig;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle(new GUIContent("ColorField"),true,true,false,null);
-        Color = Color.blue;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Color = EditorGUI.ColorField(m_DrawingRect, m_Color);
-                break;
-
-            case 2:
-                m_Color = EditorGUI.ColorField(m_DrawingRect, m_Label, m_Color);
-                break;
-
-            case 3:
-                m_Color = EditorGUI.ColorField(m_DrawingRect, m_LabelStr, m_Color);
-                break;
-
-            case 4:
-                m_Color = EditorGUI.ColorField(m_DrawingRect, m_Label, m_Color, m_ShowEyedropper, m_ShowAlpha, m_Hdr, m_ColorPickerHDRConfig);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        label = m_Label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 3;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, bool showEyedropper, bool showAlpha,bool hdr, ColorPickerHDRConfig colorPickerHDRConfig)
-    {
-        drawingStyle = 4;
-
-        m_Label = label;
-        m_ShowEyedropper = showEyedropper;
-        m_ShowAlpha = showAlpha;
-        m_Hdr = hdr;
-        m_ColorPickerHDRConfig = colorPickerHDRConfig;
-    }
-
-    public Color Color
-    {
-        get
-        {
-            return m_Color;
-        }
-        set
-        {
-            m_Color = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ColorField.cs.meta

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

+ 0 - 133
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/CurveField.cs

@@ -1,133 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESCurveField : UESDisplayObject
-{
-    protected AnimationCurve m_Value;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected Color m_Color;
-    protected Rect m_Ranges;
-    protected SerializedProperty m_SerializedValue;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("CurveField");
-        var keys = new Keyframe[]
-        {
-            new Keyframe(0,0),
-            new Keyframe(1,1)
-        };
-        Value = new AnimationCurve(keys);
-    }
-
-    public override void OnGUI()
-    {
-        if (m_Value == null) return;
-
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.CurveField(m_DrawingRect, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.CurveField(m_DrawingRect,m_Label, m_Value);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.CurveField(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-
-            case 4:
-                m_Value = EditorGUI.CurveField(m_DrawingRect, m_Value, m_Color, m_Ranges);
-                break;
-
-            case 5:
-                EditorGUI.CurveField(m_DrawingRect, m_SerializedValue, m_Color, m_Ranges);
-                break;
-
-            case 6:
-                m_Value = EditorGUI.CurveField(m_DrawingRect, m_Label, m_Value, m_Color, m_Ranges);
-                break;
-
-            case 7:
-                m_Value = EditorGUI.CurveField(m_DrawingRect, m_LabelStr, m_Value, m_Color, m_Ranges);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 3;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(Color color,Rect ranges)
-    {
-        drawingStyle = 4;
-
-        m_Color = color;
-        m_Ranges = ranges;
-    }
-
-    public void SetDrawingStyle(SerializedProperty value, Color color, Rect ranges)
-    {
-        drawingStyle = 5;
-
-        m_SerializedValue = value;
-        m_Color = color;
-        m_Ranges = ranges;
-    }
-
-    public void SetDrawingStyle(GUIContent label,Color color,Rect ranges)
-    {
-        drawingStyle = 6;
-
-        m_Label = label;
-        m_Color = color;
-        m_Ranges = ranges;
-    }
-
-    public void SetDrawingStyle(string label, Color color, Rect ranges)
-    {
-        drawingStyle = 7;
-
-        m_LabelStr = label;
-        m_Color = color;
-        m_Ranges = ranges;
-    }
-
-    /// <summary>
-    /// 关键点
-    /// </summary>
-    public AnimationCurve Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/CurveField.cs.meta

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

+ 0 - 427
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DisplayObject.cs

@@ -1,427 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESDisplayObject: UESObject
-{
-    public const int INIT_WIDTH = 300;
-    public const int INIT_HEIGHT = 16; 
-
-    [SerializeField]protected bool m_MouseEnabled;
-    [SerializeField]protected bool m_Enable;
-    [SerializeField]protected int m_Depth;
-    [SerializeField]protected internal Rect m_Rect;                     //局部尺寸
-    [SerializeField]protected Rect m_GlobalRect;                        //全局尺寸
-    [SerializeField]protected Rect m_GlobalHitArea;                     //全局热点击区域
-    [SerializeField]protected Rect? m_Mask;                             //遮罩
-    [SerializeField]protected Rect? m_GlobalAccumulationIntersectMask;  //从Stage开始累积的遮罩重叠部分
-    [SerializeField]protected Vector2 m_RectOffset;                     //子物体偏移,一般不需要设置
-    [SerializeField]protected Vector2 m_GlobalClipOffset;               //全局坐标系画布偏移值
-    [SerializeField]protected Rect m_DrawingRect;                       //当前物体渲染区域,前缀有Drawing为绘制时属性
-    [SerializeField]protected Rect m_DrawingMask;                       //渲染遮罩区域
-
-    protected UESDisplayObject m_Parent;
-    protected List<UESDisplayObject> m_Children;
-    protected internal UESStage m_Stage;
-
-    public UESDisplayObject()
-        :base()
-    {
-        m_MouseEnabled = true;
-        m_Enable = true;
-        m_Rect = new Rect();
-        m_RectOffset = Vector2.zero;
-        m_GlobalRect = new Rect();
-        m_GlobalHitArea = new Rect();
-        m_Children = new List<UESDisplayObject>();
-        m_DrawingRect = new Rect();
-        m_GlobalClipOffset = Vector2.zero;
-        Rect = new Rect(Vector2.zero, new Vector2(INIT_WIDTH, INIT_HEIGHT));
-    }
-
-    /// <summary>
-    /// 渲染子元素
-    /// </summary>
-    internal virtual void OnChildrenGUI()
-    {
-        if (Enable)
-        {
-            if (m_Mask != null) GUI.BeginClip(m_DrawingMask, Vector2.zero, Vector2.zero, false);
-
-            //渲染自身
-            GUI.SetNextControlName(m_Guid);
-            m_Stage.PushToRenderList(this);
-            OnGUI();
-
-            //渲染子物体
-            foreach (var child in m_Children)
-            {
-                if (child.Enable) child.OnChildrenGUI();
-            }
-
-            if (m_Mask != null) GUI.EndClip();
-        }
-    }
-
-    /// <summary>
-    /// 更新子元素
-    /// </summary>
-    internal virtual void OnChildrenUpdate()
-    {
-        if (Enable)
-        {
-            Update();
-            foreach (var child in m_Children)
-            {
-                if (child.Enable)
-                {
-                    child.OnChildrenUpdate();
-                }
-            }
-        }
-    }
-
-    /// <summary>
-    /// 渲染自身
-    /// </summary>
-    public virtual void OnGUI() { }
-
-    /// <summary>
-    /// 更新自身,有需要重写此方法
-    /// </summary>
-    public virtual new void Update() { }
-
-    /// <summary>
-    /// 舞台
-    /// </summary>
-    public UESStage Stage { get { return m_Stage; } }
-
-    /// <summary>
-    /// 是否接受鼠标事件
-    /// </summary>
-    public bool MouseEnabled { get { return m_MouseEnabled; } set { m_MouseEnabled = value; } }
-
-    /// <summary>
-    /// 舞台坐标系热交互区域
-    /// </summary>
-    public Rect GlobalHitArea { get { return m_GlobalHitArea; } }
-
-    /// <summary>
-    /// 父级容器
-    /// </summary>
-    public virtual UESDisplayObject Parent { get { return m_Parent; } }
-
-    /// <summary>
-    /// 子元素列表
-    /// </summary>
-    public List<UESDisplayObject> Children { get { return m_Children; } }
-
-    /// <summary>
-    /// 相对于父级的渲染深度
-    /// </summary>
-    public virtual int Depth
-    {
-        get
-        {
-            return m_Depth;
-        }
-        set
-        {
-            m_Depth = value;
-            if(m_Parent!=null)m_Parent.SortByDepth();
-        }
-    }
-
-    /// <summary>
-    /// 遮罩
-    /// 使用自身坐标系,不使用遮罩设置值为null
-    /// </summary>
-    public virtual Rect? Mask
-    {
-        get
-        {
-            return m_Mask;
-        }
-        set
-        {
-            m_Mask = value;
-            UpdateValues(m_Parent);
-        }
-    }
-
-    public int GlobalDepth
-    {
-        get
-        {
-            if (m_Stage == null) return -1;
-            return m_Stage.RenderList.IndexOf(this);
-        }
-    }
-
-    /// <summary>
-    /// 局部坐标
-    /// </summary>
-    public Vector2 Position
-    {
-        get
-        {
-            return m_Rect.position;
-        }
-        set
-        {
-            Rect = new Rect(value, m_Rect.size);
-        }
-    }
-
-    /// <summary>
-    /// 局部尺寸
-    /// </summary>
-    public Vector2 Size
-    {
-        get
-        {
-            return m_Rect.size;
-        }
-        set
-        {
-            Rect = new Rect(m_Rect.position, value);
-        }
-    }
-
-    /// <summary>
-    /// 局部显示区域
-    /// </summary>
-    public virtual Rect Rect
-    {
-        get
-        {
-            return m_Rect;
-        }
-        set
-        {
-            m_Rect = value;
-            UpdateValues(m_Parent);
-        }
-    }
-
-    /// <summary>
-    /// 全局显示区域
-    /// </summary>
-    public virtual Rect GlobalRect {
-        get
-        {
-            return m_GlobalRect;
-        }
-        set
-        {
-            if (m_Stage == null)
-            {
-                Debug.LogError("元素尚未添加到舞台,设置此值无效!");
-                return;
-            }
-
-            Rect = new Rect(Global2Local(m_Parent, value.position), value.size);
-        }
-    }
-
-    /// <summary>
-    /// 激活
-    /// </summary>
-    public virtual bool Enable { get { return m_Enable; } set { m_Enable = value; } }
-
-    /// <summary>
-    /// 添加子元素
-    /// </summary>
-    /// <param name="child"></param>
-    public virtual void AddChild(UESDisplayObject child)
-    {
-        if (child is UESStage) { Debug.LogError(child + "舞台不能作为子元素"); return; }
-        if (child == null) { Debug.Log(child + "为null"); return; }
-        if (child == this) { Debug.LogError("不能添加自己"); return; }
-        if (m_Children.Contains(child)) { Debug.Log(child + "重复添加了"); return; }
-
-        if (child.m_Parent != null) child.m_Parent.RemoveChild(child);
-        child.m_Parent = this;
-        m_Children.Add(child);
-        int depth = 0;
-        foreach (var item in m_Children)
-        {
-            depth = Mathf.Max(item.m_Depth,depth);
-        }
-        child.Depth = depth + 1;
-        UpdateValues(this);
-    }
-
-    /// <summary>
-    /// 移除子元素
-    /// </summary>
-    /// <param name="index">子元素索引</param>
-    public virtual void RemoveAt(int index)
-    {
-        if (index >= 0 && index < m_Children.Count)
-        {
-            RemoveChild(m_Children[index]);
-        }
-        else Debug.LogError("索引越界");
-    }
-
-    /// <summary>
-    /// 移除子元素
-    /// </summary>
-    /// <param name="child"></param>
-    public virtual void RemoveChild(UESDisplayObject child)
-    {
-        if (child == null)
-        {
-            Debug.Log("child不能为null");
-            return;
-        }
-        if (!m_Children.Contains(child))
-        {
-            Debug.Log("不包含"+child);
-            return;
-        }
-
-        child.m_Parent = null;
-        child.m_Stage = null;
-        m_Children.Remove(child);
-        UpdateValues(this);
-    }
-
-    /// <summary>
-    /// 更新数据
-    /// 从Stage根结点递归子物体由上至下更新,所以默认为父级数据已更新完为最新数据,子物体数据依赖于父级
-    /// </summary>
-    /// <param name="display"></param>
-    protected virtual void UpdateValues(UESDisplayObject display)
-    {
-        if (display == null) return;
-
-        if (display.m_Parent != null)
-            display.m_Stage = display.m_Parent.m_Stage;
-        else if(!(display is UESStage)) display.m_Stage = null;
-
-        //更新自身数值
-        if (display.m_Stage != null && display.m_Parent != null&&!(display is UESStage))
-        {
-            //舞台坐标系,其他属性依赖于此值更新
-            display.m_GlobalRect = new Rect(display.m_Parent.m_GlobalRect.position + display.m_Parent.m_RectOffset + display.m_Rect.position, display.m_Rect.size);
-
-            //渲染相关
-            display.m_GlobalClipOffset = display.m_Parent.m_GlobalClipOffset;
-            display.m_GlobalAccumulationIntersectMask = display.m_Parent.m_GlobalAccumulationIntersectMask;
-            var offset = display.m_Parent.m_GlobalRect.position - display.m_Parent.m_GlobalClipOffset + display.m_Rect.position;
-            if (display.m_Mask != null)
-            {
-                var maskRect = (Rect)display.m_Mask;
-                display.m_DrawingMask = new Rect(offset + maskRect.position, maskRect.size);
-                display.m_GlobalClipOffset += display.m_DrawingMask.position;
-                display.m_DrawingRect = new Rect(-maskRect.position, display.m_Rect.size);
-
-                var globalMask = new Rect(display.m_GlobalRect.position + maskRect.position, maskRect.size);
-                if (display.m_GlobalAccumulationIntersectMask != null) display.m_GlobalAccumulationIntersectMask = UESTool.GetRectIntersect((Rect)display.m_GlobalAccumulationIntersectMask, globalMask);
-                else display.m_GlobalAccumulationIntersectMask = globalMask;
-            }
-            else
-            {
-                display.m_DrawingRect = new Rect(offset, display.m_Rect.size);
-            }
-
-            //全局热点击区域
-            if (display.m_GlobalAccumulationIntersectMask != null) display.m_GlobalHitArea = UESTool.GetRectIntersect((Rect)display.m_GlobalAccumulationIntersectMask, display.m_GlobalRect);
-            else display.m_GlobalHitArea = display.m_GlobalRect;
-
-            //子类重写此方法更新其他值
-            if (display == this) UpdateSelf();
-        }
-
-        //更新子物体
-        foreach (var child in display.m_Children)
-        {
-            child.UpdateValues(child);
-        }
-    }
-
-    /// <summary>
-    /// 重写此方法更新自身其他值
-    /// </summary>
-    protected virtual void UpdateSelf()
-    {
-
-    }
-
-    /// <summary>
-    /// 按照深度排序
-    /// </summary>
-    protected void SortByDepth()
-    {
-        m_Children.Sort(
-            (a, b) =>
-            {
-                if (a.Depth == b.Depth) return 0;
-                else return a.Depth > b.Depth ? 1 : -1;
-            }
-            );
-    }
-
-    /// <summary>
-    /// 判断点是否与此元素碰撞
-    /// 一般情况下hitArea包含globalPoint即可以碰撞,特殊情况根据情况重写,如内部显示为矢量贝塞尔曲线
-    /// </summary>
-    /// <param name="globalPoint"></param>
-    /// <returns></returns>
-    public virtual bool IsHit(Vector2 globalPoint)
-    {
-        return m_GlobalHitArea.Contains(globalPoint);
-    }
-
-    /// <summary>
-    /// 开始拖拽
-    /// </summary>
-    public void StartDrag()
-    {
-        if (m_Stage == null) return;
-
-        m_Stage.StartDrag(this);
-    }
-
-    /// <summary>
-    /// 停止拖拽
-    /// </summary>
-    public void StopDrag()
-    {
-        if (m_Stage == null) return;
-
-        m_Stage.StopDrag(this);
-    }
-
-    /// <summary>
-    /// 局部坐标-->全局坐标
-    /// </summary>
-    /// <param name="container"></param>
-    /// <param name="point"></param>
-    /// <returns></returns>
-    public static Vector2 Local2Global(UESDisplayObject container, Vector2 point)
-    {
-        if (container.Stage == null)
-        {
-            Debug.LogWarning("对象尚未添加到舞台,不能计算坐标!");
-            return Vector3.zero;
-        }
-
-        return container.GlobalRect.position + point;
-    }
-
-    /// <summary>
-    /// 全局坐标-->局部坐标
-    /// </summary>
-    /// <param name="container"></param>
-    /// <param name="point"></param>
-    /// <returns></returns>
-    public static Vector2 Global2Local(UESDisplayObject container, Vector2 point)
-    {
-        return point - Local2Global(container, Vector2.zero);
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DisplayObject.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DoubleField.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESDoubleField : UESDisplayObject
-{
-    protected double m_Value;
-    protected int drawingStyle;
-    protected GUIStyle m_Style;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("DoubleField");
-        Value = double.MaxValue;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.DoubleField(m_DrawingRect, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.DoubleField(m_DrawingRect, m_Value, m_Style);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.DoubleField(m_DrawingRect, m_Label, m_Value);
-                break;
-
-            case 4:
-                m_Value = EditorGUI.DoubleField(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-
-            case 5:
-                m_Value = EditorGUI.DoubleField(m_DrawingRect, m_Label, m_Value, m_Style);
-                break;
-
-            case 6:
-                m_Value = EditorGUI.DoubleField(m_DrawingRect, m_LabelStr, m_Value, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label,GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public double Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/DoubleField.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskField.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEditor;
-
-public class UESEnumMaskField : UESDisplayObject
-{
-    protected Enum m_EnumValue;
-    protected int drawingStyle;
-    protected GUIStyle m_Style;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("EnumMaskField");
-        m_EnumValue = TestEnums.One;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_EnumValue = EditorGUI.EnumMaskField(m_DrawingRect, m_EnumValue);
-                break;
-
-            case 2:
-                m_EnumValue = EditorGUI.EnumMaskField(m_DrawingRect, m_EnumValue,m_Style);
-                break;
-
-            case 3:
-                m_EnumValue = EditorGUI.EnumMaskField(m_DrawingRect, m_Label, m_EnumValue);
-                break;
-
-            case 4:
-                m_EnumValue = EditorGUI.EnumMaskField(m_DrawingRect, m_LabelStr, m_EnumValue);
-                break;
-
-            case 5:
-                m_EnumValue = EditorGUI.EnumMaskField(m_DrawingRect, m_Label, m_EnumValue,m_Style);
-                break;
-
-            case 6:
-                m_EnumValue = EditorGUI.EnumMaskField(m_DrawingRect, m_LabelStr, m_EnumValue,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public Enum EnumValue
-    {
-        get
-        {
-            return m_EnumValue;
-        }
-        set
-        {
-            m_EnumValue = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskField.cs.meta

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

+ 0 - 61
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskPopup.cs

@@ -1,61 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEditor;
-
-public class UESEnumMaskPopup : UESDisplayObject
-{
-    protected Enum m_Selected;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle(new GUIContent("EnumMaskPopup"));
-        m_Selected = TestEnums.One;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Selected = EditorGUI.EnumMaskPopup(m_DrawingRect, m_Label, m_Selected);
-                break;
-
-            case 2:
-                m_Selected = EditorGUI.EnumMaskPopup(m_DrawingRect, m_Label, m_Selected,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 1;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public Enum Selected
-    {
-        get
-        {
-            return m_Selected;
-        }
-        set
-        {
-            m_Selected = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumMaskPopup.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumPopup.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESEnumPopup : UESDisplayObject
-{
-    protected Enum m_Selected;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected GUIStyle m_Style;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("EnumPopup");
-        m_Selected = TestEnums.One;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Selected = EditorGUI.EnumPopup(m_DrawingRect, m_Selected);
-                break;
-
-            case 2:
-                m_Selected = EditorGUI.EnumPopup(m_DrawingRect, m_Selected, m_Style);
-                break;
-
-            case 3:
-                m_Selected = EditorGUI.EnumPopup(m_DrawingRect, m_Label, m_Selected);
-                break;
-
-            case 4:
-                m_Selected = EditorGUI.EnumPopup(m_DrawingRect, m_LabelStr, m_Selected);
-                break;
-
-            case 5:
-                m_Selected = EditorGUI.EnumPopup(m_DrawingRect, m_Label, m_Selected, m_Style);
-                break;
-
-            case 6:
-                m_Selected = EditorGUI.EnumPopup(m_DrawingRect, m_LabelStr, m_Selected, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public Enum Selected
-    {
-        get
-        {
-            return m_Selected;
-        }
-        set
-        {
-            m_Selected = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/EnumPopup.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/FloatField.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESFloatField : UESDisplayObject
-{
-    protected float m_Value;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected GUIStyle m_Style;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("FloatField");
-        Value = float.MaxValue;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.FloatField(m_DrawingRect, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.FloatField(m_DrawingRect, m_Value, m_Style);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.FloatField(m_DrawingRect, m_Label, m_Value);
-                break;
-
-            case 4:
-                m_Value = EditorGUI.FloatField(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-
-            case 5:
-                m_Value = EditorGUI.FloatField(m_DrawingRect, m_Label, m_Value,m_Style);
-                break;
-
-            case 6:
-                m_Value = EditorGUI.FloatField(m_DrawingRect, m_LabelStr, m_Value,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public float Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/FloatField.cs.meta

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

+ 0 - 136
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Foldout.cs

@@ -1,136 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESFoldout : UESDisplayObject {
-
-    protected bool m_Foldout;
-    protected bool m_ToggleOnLabelClick;
-    protected int drawingStyle;
-    protected GUIContent m_Content;
-    protected string m_ContentStr;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("Foldout",true);
-        Foldout = true;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_Content);
-                break;
-
-            case 2:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_ContentStr);
-                break;
-
-            case 3:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_Content, m_ToggleOnLabelClick);
-                break;
-
-            case 4:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_Content, m_Style);
-                break;
-
-            case 5:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_ContentStr, m_ToggleOnLabelClick);
-                break;
-
-            case 6:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_ContentStr, m_Style);
-                break;
-
-            case 7:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_Content, m_ToggleOnLabelClick, m_Style);
-                break;
-
-            case 8:
-                m_Foldout = EditorGUI.Foldout(m_DrawingRect, m_Foldout, m_ContentStr, m_ToggleOnLabelClick, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent content)
-    {
-        drawingStyle = 1;
-
-        m_Content = content;
-    }
-
-    public void SetDrawingStyle(string content)
-    {
-        drawingStyle = 2;
-
-        m_ContentStr = content;
-    }
-
-    public void SetDrawingStyle(GUIContent content,bool toggleOnLabelClick)
-    {
-        drawingStyle = 3;
-
-        m_Content = content;
-        m_ToggleOnLabelClick = toggleOnLabelClick;
-    }
-
-    public void SetDrawingStyle(GUIContent content,GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_Content = content;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string content, bool toggleOnLabelClick)
-    {
-        drawingStyle = 5;
-
-        m_ContentStr = content;
-        m_ToggleOnLabelClick = toggleOnLabelClick;
-    }
-
-    public void SetDrawingStyle(string content, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_ContentStr = content;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(GUIContent content, bool toggleOnLabelClick,GUIStyle style)
-    {
-        drawingStyle = 7;
-
-        m_Content = content;
-        m_ToggleOnLabelClick = toggleOnLabelClick;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string content, bool toggleOnLabelClick, GUIStyle style)
-    {
-        drawingStyle = 8;
-
-        m_ContentStr = content;
-        m_ToggleOnLabelClick = toggleOnLabelClick;
-        m_Style = style;
-    }
-
-    public bool Foldout
-    {
-        get
-        {
-            return m_Foldout;
-        }
-        set
-        {
-            m_Foldout = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Foldout.cs.meta

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

+ 0 - 29
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HelpBox.cs

@@ -1,29 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESHelpBox : UESDisplayObject {
-
-    protected string m_Message;
-    protected MessageType m_MessageType;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("message info...");
-        Rect = new Rect(Vector2.zero,new Vector2(INIT_WIDTH,48));
-    }
-
-    public override void OnGUI()
-    {
-        EditorGUI.HelpBox(m_DrawingRect, m_Message, m_MessageType);
-    }
-
-    public void SetDrawingStyle(string message,MessageType messageType=MessageType.Info)
-    {
-        m_Message = message;
-        m_MessageType = messageType;
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HelpBox.cs.meta

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

+ 0 - 66
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HorizontalSlider.cs

@@ -1,66 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESHorizontalSlider : UESDisplayObject
-{
-    protected float m_Value;
-    protected float m_LeftValue;
-    protected float m_RightValue;
-    protected int drawingStyle;
-    protected GUIStyle m_Slider;
-    protected GUIStyle m_Thumb;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle(0, 100);
-        Value = 30;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = GUI.HorizontalSlider(m_DrawingRect, m_Value, m_LeftValue, m_RightValue);
-                break;
-
-            case 2:
-                m_Value = GUI.HorizontalSlider(m_DrawingRect, m_Value, m_LeftValue, m_RightValue, m_Slider,m_Thumb);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(float leftValue,float rightValue)
-    {
-        drawingStyle = 1;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-    }
-
-    public void SetDrawingStyle(float leftValue, float rightValue,GUIStyle slider,GUIStyle thumb)
-    {
-        drawingStyle = 2;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-        m_Slider = slider;
-        m_Thumb = thumb;
-    }
-
-    public float Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/HorizontalSlider.cs.meta

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

+ 0 - 72
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/InspectorTitlebar.cs

@@ -1,72 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESInspectorTitlebar : UESDisplayObject {
-
-    protected UnityEngine.Object[] m_TargetObjs;
-    protected UnityEngine.Object m_TargetObj;
-    protected bool m_Foldout;
-    protected bool m_Expandable;
-    protected int drawingStyle;
-
-    protected override void Awake()
-    {
-        SetDrawingStyle(Camera.main, true);
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                EditorGUI.InspectorTitlebar(m_DrawingRect, m_TargetObjs);
-                break;
-
-            case 2:
-                m_Foldout = EditorGUI.InspectorTitlebar(m_DrawingRect, m_Foldout, m_TargetObj, m_Expandable);
-                break;
-
-            case 3:
-                m_Foldout = EditorGUI.InspectorTitlebar(m_DrawingRect, m_Foldout, m_TargetObjs, m_Expandable);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(UnityEngine.Object[] targetObjs)
-    {
-        drawingStyle = 1;
-
-        m_TargetObjs = targetObjs;
-    }
-
-    public void SetDrawingStyle(UnityEngine.Object targetObj, bool expandable)
-    {
-        drawingStyle = 2;
-
-        m_TargetObj = targetObj;
-        m_Expandable = expandable;
-    }
-
-    public void SetDrawingStyle(UnityEngine.Object[] targetObjs,bool expandable)
-    {
-        drawingStyle = 3;
-
-        m_TargetObjs = targetObjs;
-        m_Expandable = expandable;
-    }
-
-    public bool Foldout
-    {
-        get
-        {
-            return m_Foldout;
-        }
-        set
-        {
-            m_Foldout = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/InspectorTitlebar.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntField.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESIntField:UESDisplayObject{
-
-    protected int m_Value;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("IntField");
-        Value = int.MaxValue;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.IntField(m_DrawingRect, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.IntField(m_DrawingRect,m_Label,m_Value);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.IntField(m_DrawingRect,m_Value,m_Style);
-                break;
-
-            case 4:
-                m_Value = EditorGUI.IntField(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-
-            case 5:
-                m_Value = EditorGUI.IntField(m_DrawingRect, m_Label, m_Value,m_Style);
-                break;
-
-            case 6:
-                m_Value = EditorGUI.IntField(m_DrawingRect, m_LabelStr, m_Value, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public int Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntField.cs.meta

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

+ 0 - 186
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntPopup.cs

@@ -1,186 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESIntPopup : UESDisplayObject
-{
-    protected int m_SelectedValue;
-    protected int[] m_OptionValues;
-    protected GUIContent[] m_DisplayedOptions;
-    protected string[] m_StrDisplayedOptions;
-    protected int drawingStyle;
-    protected SerializedProperty m_Property;
-    protected GUIContent m_Label;
-    protected GUIStyle m_Style;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        var displayOptions = new string[]
-        {
-            "1",
-            "2",
-            "3"
-        };
-        var optionValues = new int[]
-        {
-            1,
-            2,
-            3
-        };
-        SetDrawingStyle("IntPopup", displayOptions, optionValues);
-        SelectedValue = 1;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_SelectedValue, m_DisplayedOptions, m_OptionValues);
-                break;
-
-            case 2:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_SelectedValue, m_StrDisplayedOptions, m_OptionValues);
-                break;
-
-            case 3:
-                EditorGUI.IntPopup(m_DrawingRect, m_Property, m_DisplayedOptions, m_OptionValues);
-                break;
-
-            case 4:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_Label, m_SelectedValue, m_DisplayedOptions, m_OptionValues);
-                break;
-
-            case 5:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_SelectedValue, m_DisplayedOptions, m_OptionValues,m_Style);
-                break;
-
-            case 6:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_SelectedValue, m_StrDisplayedOptions, m_OptionValues, m_Style);
-                break;
-
-            case 7:
-                EditorGUI.IntPopup(m_DrawingRect, m_Property, m_DisplayedOptions, m_OptionValues,m_Label);
-                break;
-
-            case 8:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_LabelStr,m_SelectedValue, m_StrDisplayedOptions, m_OptionValues);
-                break;
-
-            case 9:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_Label, m_SelectedValue, m_DisplayedOptions, m_OptionValues,m_Style);
-                break;
-
-            case 10:
-                m_SelectedValue = EditorGUI.IntPopup(m_DrawingRect, m_LabelStr, m_SelectedValue, m_StrDisplayedOptions, m_OptionValues,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent[] displayedOptions,int[] optionValues)
-    {
-        drawingStyle = 1;
-
-        m_DisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-    }
-
-    public void SetDrawingStyle(string[] displayedOptions, int[] optionValues)
-    {
-        drawingStyle = 2;
-
-        m_StrDisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-    }
-
-    public void SetDrawingStyle(SerializedProperty property, GUIContent[] displayedOptions, int[] optionValues)
-    {
-        drawingStyle = 3;
-
-        m_Property = property;
-        m_DisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIContent[] displayedOptions, int[] optionValues)
-    {
-        drawingStyle = 4;
-
-        m_Label = label;
-        m_DisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-    }
-
-    public void SetDrawingStyle(GUIContent[] displayedOptions, int[] optionValues,GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_DisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string[] displayedOptions, int[] optionValues,GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_StrDisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(SerializedProperty property,GUIContent[] displayedOptions, int[] optionValues, GUIContent label)
-    {
-        drawingStyle = 7;
-
-        m_Property = property;
-        m_DisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label,string[] displayedOptions, int[] optionValues)
-    {
-        drawingStyle = 8;
-
-        m_StrDisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIContent[] displayedOptions, int[] optionValues,GUIStyle style)
-    {
-        drawingStyle = 9;
-
-        m_Label = label;
-        m_DisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, string[] displayedOptions, int[] optionValues,GUIStyle style)
-    {
-        drawingStyle = 10;
-
-        m_StrDisplayedOptions = displayedOptions;
-        m_OptionValues = optionValues;
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public int SelectedValue
-    {
-        get
-        {
-            return m_SelectedValue;
-        }
-        set
-        {
-            m_SelectedValue = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntPopup.cs.meta

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

+ 0 - 120
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntSlider.cs

@@ -1,120 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESIntSlider : UESDisplayObject
-{
-    protected int m_Value;
-    protected int m_LeftValue;
-    protected int m_RightValue;
-    protected int drawingStyle;
-    protected SerializedProperty m_Property;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("IntSlider", 0, 100);
-        Value = 30;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.IntSlider(m_DrawingRect, m_Value, m_LeftValue, m_RightValue);
-                break;
-
-            case 2:
-                EditorGUI.IntSlider(m_DrawingRect, m_Property, m_LeftValue, m_RightValue);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.IntSlider(m_DrawingRect,m_Label, m_Value, m_LeftValue, m_RightValue);
-                break;
-
-            case 4:
-                EditorGUI.IntSlider(m_DrawingRect,m_Property, m_LeftValue, m_RightValue,m_Label);
-                break;
-
-            case 5:
-                EditorGUI.IntSlider(m_DrawingRect, m_Property, m_LeftValue, m_RightValue, m_LabelStr);
-                break;
-
-            case 6:
-                m_Value = EditorGUI.IntSlider(m_DrawingRect,m_LabelStr, m_Value, m_LeftValue, m_RightValue);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(int leftValue,int rightValue)
-    {
-        drawingStyle = 1;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-    }
-
-    public void SetDrawingStyle(SerializedProperty property,int leftValue, int rightValue)
-    {
-        drawingStyle = 2;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-        m_Property = property;
-    }
-
-    public void SetDrawingStyle(GUIContent label, int leftValue, int rightValue)
-    {
-        drawingStyle = 3;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(SerializedProperty property, int leftValue, int rightValue,GUIContent label)
-    {
-        drawingStyle = 4;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-        m_Property = property;
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(SerializedProperty property, int leftValue, int rightValue, string label)
-    {
-        drawingStyle = 5;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-        m_Property = property;
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(string label, int leftValue, int rightValue)
-    {
-        drawingStyle = 6;
-
-        m_LeftValue = leftValue;
-        m_RightValue = rightValue;
-        m_LabelStr = label;
-    }
-
-    public int Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/IntSlider.cs.meta

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

+ 0 - 123
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LabelField.cs

@@ -1,123 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESLabelField : UESDisplayObject {
-
-    protected string m_LabelStr;
-    protected string m_LabelStr2;
-    protected GUIContent m_Label;
-    protected GUIStyle m_Style;
-    protected GUIContent m_Label2;
-    protected int drawingStyle;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("This is LabelField...");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                EditorGUI.LabelField(m_DrawingRect, m_Label);
-                break;
-
-            case 2:
-                EditorGUI.LabelField(m_DrawingRect, m_LabelStr);
-                break;
-
-            case 3:
-                EditorGUI.LabelField(m_DrawingRect, m_Label, m_Label2);
-                break;
-
-            case 4:
-                EditorGUI.LabelField(m_DrawingRect, m_Label, m_Style);
-                break;
-
-            case 5:
-                EditorGUI.LabelField(m_DrawingRect, m_LabelStr, m_Style);
-                break;
-
-            case 6:
-                EditorGUI.LabelField(m_DrawingRect, m_LabelStr,m_LabelStr2);
-                break;
-
-            case 7:
-                EditorGUI.LabelField(m_DrawingRect, m_Label, m_Label2,m_Style);
-                break;
-
-            case 8:
-                EditorGUI.LabelField(m_DrawingRect, m_LabelStr, m_LabelStr2,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 1;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 2;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIContent label2)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-        m_Label2 = label2;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label,GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label,string label2)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_LabelStr2 = label2;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIContent label2,GUIStyle style)
-    {
-        drawingStyle = 7;
-
-        m_Label = label;
-        m_Label2 = label2;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, string label2,GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_LabelStr2 = label2;
-        m_Style = style;
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LabelField.cs.meta

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

+ 0 - 104
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LayerField.cs

@@ -1,104 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESLayerField : UESDisplayObject {
-
-    protected int m_Layer;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected GUIStyle m_Style;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("LayerField");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Layer = EditorGUI.LayerField(m_DrawingRect, m_Layer);
-                break;
-
-            case 2:
-                m_Layer = EditorGUI.LayerField(m_DrawingRect,m_Label,m_Layer);
-                break;
-
-            case 3:
-                m_Layer = EditorGUI.LayerField(m_DrawingRect, m_Layer, m_Style);
-                break;
-
-            case 4:
-                m_Layer = EditorGUI.LayerField(m_DrawingRect,m_LabelStr ,m_Layer);
-                break;
-
-            case 5:
-                m_Layer = EditorGUI.LayerField(m_DrawingRect, m_Label, m_Layer,m_Style);
-                break;
-
-            case 6:
-                m_Layer = EditorGUI.LayerField(m_DrawingRect, m_LabelStr, m_Layer, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public int Layer
-    {
-        get
-        {
-            return m_Layer;
-        }
-        set
-        {
-            m_Layer = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LayerField.cs.meta

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

+ 0 - 128
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Line.cs

@@ -1,128 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEditor;
-
-/// <summary>
-/// 绘制直线
-/// </summary>
-public class UESLine : UESDisplayObject
-{
-    const float HIT_WIDTH_MIN = 10f;                        //线的最小碰撞宽度
-
-    protected Vector2[] m_Points;
-    protected Vector2[] m_DrawingPoints;
-    protected Vector2[] m_GlobalPoints;
-    protected Color m_Color;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle(Color.white);
-        Points = new Vector2[]
-        {
-            new Vector2(0,0),
-            new Vector2(150,30),
-            new Vector2(300,0)
-        };
-    }
-
-    public override void OnGUI()
-    {
-        base.OnGUI();
-
-        if (m_DrawingPoints == null|| m_DrawingPoints.Length<2) return;
-
-        Handles.BeginGUI();
-        Handles.color = m_Color;
-        for (var i=0;i< m_DrawingPoints.Length - 1;i++)
-        {
-            Handles.DrawLine(m_DrawingPoints[i], m_DrawingPoints[i+1]);
-        }
-        Handles.EndGUI();
-    }
-
-    protected override void UpdateSelf()
-    {
-        m_DrawingPoints = new Vector2[m_Points.Length];
-        var containsPointRect = UESTool.GetContainsPointsRect(m_Points);
-        for (var i = 0; i < m_DrawingPoints.Length; i++)
-        {
-            m_DrawingPoints[i] = m_Points[i] + m_DrawingRect.position - containsPointRect.position;
-        }
-        m_GlobalPoints = new Vector2[m_Points.Length];
-        for (var i = 0; i < m_GlobalPoints.Length; i++)
-        {
-            m_GlobalPoints[i] = Local2Global(m_Parent, m_Points[i]);
-        }
-    }
-
-    public override Rect Rect
-    {
-        get
-        {
-            return base.Rect;
-        }
-
-        set
-        {
-            if (m_Points == null)
-            {
-                //Debug.Log("直接设置Points");
-                return;
-            }
-
-            var containsPointRect = UESTool.GetContainsPointsRect(m_Points);
-            var offset = value.position - containsPointRect.position;
-            for(var i=0;i<m_Points.Length;i++)
-            {
-                m_Points[i] = new Vector2(m_Points[i].x + offset.x, m_Points[i].y + offset.y);
-            }
-            Points = m_Points;
-        }
-    }
-
-    public void SetDrawingStyle(Color color)
-    {
-        m_Color = color;
-    }
-
-    public Vector2[] Points
-    {
-        get
-        {
-            return m_Points;
-        }
-        set
-        {
-            if (value.Length < 2)
-            {
-                Debug.Log("最少2个点.");
-                return;
-            }
-
-            m_Points = value;
-            var containsPointRect = UESTool.GetContainsPointsRect(value);
-            m_Rect = containsPointRect;
-            UpdateValues(m_Parent);
-        }
-    }
-
-    public override bool IsHit(Vector2 globalPoint)
-    {
-        if (m_GlobalPoints == null) return false;
-        if (!base.IsHit(globalPoint)) return false;
-
-        for (var i = 0; i < m_GlobalPoints.Length - 1; i++)
-        {
-            var dist = HandleUtility.DistancePointLine(globalPoint, m_GlobalPoints[i], m_GlobalPoints[i + 1]);
-            if (dist < HIT_WIDTH_MIN)
-            {
-                return true;
-            }
-        }
-
-        return false;
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Line.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LongField.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESLongField : UESDisplayObject
-{
-    protected long m_Value;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected GUIStyle m_Style;
-    protected int drawingStyle;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("LongField");
-        Value = long.MaxValue;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.LongField(m_DrawingRect, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.LongField(m_DrawingRect, m_Label, m_Value);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.LongField(m_DrawingRect, m_Value, m_Style);
-                break;
-
-            case 4:
-                m_Value = EditorGUI.LongField(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-
-            case 5:
-                m_Value = EditorGUI.LongField(m_DrawingRect, m_Label, m_Value, m_Style);
-                break;
-
-            case 6:
-                m_Value = EditorGUI.LongField(m_DrawingRect, m_LabelStr, m_Value, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public long Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/LongField.cs.meta

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

+ 0 - 119
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/MaskField.cs

@@ -1,119 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESMaskField : UESDisplayObject
-{
-    protected int m_MaskValue;
-    protected string[] m_DisplayOptions;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected int drawingStyle;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        var displayOptions = new string[]
-        {
-            "1",
-            "2",
-            "3"
-        };
-        SetDrawingStyle("MaskField", displayOptions);
-        MaskValue = 0;
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_MaskValue = EditorGUI.MaskField(m_DrawingRect,m_MaskValue,m_DisplayOptions);
-                break;
-
-            case 2:
-                m_MaskValue = EditorGUI.MaskField(m_DrawingRect, m_Label, m_MaskValue, m_DisplayOptions);
-                break;
-
-            case 3:
-                m_MaskValue = EditorGUI.MaskField(m_DrawingRect, m_MaskValue, m_DisplayOptions, m_Style);
-                break;
-
-            case 4:
-                m_MaskValue = EditorGUI.MaskField(m_DrawingRect, m_LabelStr, m_MaskValue, m_DisplayOptions);
-                break;
-
-            case 5:
-                m_MaskValue = EditorGUI.MaskField(m_DrawingRect, m_Label, m_MaskValue, m_DisplayOptions, m_Style);
-                break;
-
-            case 6:
-                m_MaskValue = EditorGUI.MaskField(m_DrawingRect, m_LabelStr, m_MaskValue, m_DisplayOptions, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(string[] displayOptions)
-    {
-        drawingStyle = 1;
-
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(GUIContent label, string[] displayOptions)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(string[] displayOptions,GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Style = style;
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(string label, string[] displayOptions)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(GUIContent label, string[] displayOptions,GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_DisplayOptions = displayOptions;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, string[] displayOptions, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_DisplayOptions = displayOptions;
-        m_Style = style;
-    }
-
-    public int MaskValue
-    {
-        get
-        {
-            return m_MaskValue;
-        }
-        set
-        {
-            m_MaskValue = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/MaskField.cs.meta

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

+ 0 - 141
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ObjectField.cs

@@ -1,141 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESObjectField : UESDisplayObject
-{
-    protected SerializedProperty m_Property;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected Type m_ObjType;
-    protected UnityEngine.Object m_Obj;
-    protected bool m_AllowSceneObjects;
-    protected int drawingStyle;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("ObjectField",Camera.main, typeof(Camera), true);
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                //EditorGUI.ObjectField(m_DrawingRect, m_Property);
-                break;
-
-            case 2:
-                EditorGUI.ObjectField(m_DrawingRect, m_Property, m_Label);
-                break;
-
-            case 3:
-                //EditorGUI.ObjectField(m_DrawingRect, m_Property, m_ObjType);
-                break;
-
-            case 4:
-                //EditorGUI.ObjectField(m_DrawingRect, m_Obj, m_ObjType);
-                break;
-
-            case 5:
-                //EditorGUI.ObjectField(m_DrawingRect, m_Label, m_Obj, m_ObjType);
-                break;
-
-            case 6:
-                EditorGUI.ObjectField(m_DrawingRect, m_Property, m_ObjType, m_Label);
-                break;
-
-            case 7:
-                //EditorGUI.ObjectField(m_DrawingRect, m_LabelStr, m_Obj, m_ObjType);
-                break;
-
-            case 8:
-                m_Obj=EditorGUI.ObjectField(m_DrawingRect, m_Obj, m_ObjType, m_AllowSceneObjects);
-                break;
-
-            case 9:
-                m_Obj = EditorGUI.ObjectField(m_DrawingRect, m_Label, m_Obj, m_ObjType, m_AllowSceneObjects);
-                break;
-
-            case 10:
-                m_Obj = EditorGUI.ObjectField(m_DrawingRect, m_LabelStr, m_Obj, m_ObjType, m_AllowSceneObjects);
-                break;
-        }
-    }
-
-    //public void SetDrawingStyle(SerializedProperty property)
-    //{
-    //    drawingStyle = 1;
-
-    //    m_Property = property;
-    //}
-
-    public void SetDrawingStyle(SerializedProperty property,GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Property = property;
-        m_Label = label;
-    }
-
-    //public void SetDrawingStyle(SerializedProperty property,Type objType)
-    //{
-    //    drawingStyle = 3;
-
-    //    m_Property = property;
-    //    m_ObjType = objType;
-    //}
-
-    public void SetDrawingStyle(SerializedProperty property,Type objType,GUIContent label)
-    {
-        drawingStyle = 6;
-
-        m_Property = property;
-        m_ObjType = objType;
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(UnityEngine.Object obj,Type objType,bool allowSceneObjects)
-    {
-        drawingStyle = 8;
-
-        m_Obj = obj;
-        m_ObjType = objType;
-        m_AllowSceneObjects = allowSceneObjects;
-    }
-
-    public void SetDrawingStyle(GUIContent label,UnityEngine.Object obj, Type objType, bool allowSceneObjects)
-    {
-        drawingStyle = 9;
-
-        m_Label = label;
-        m_Obj = obj;
-        m_ObjType = objType;
-        m_AllowSceneObjects = allowSceneObjects;
-    }
-
-    public void SetDrawingStyle(string label, UnityEngine.Object obj, Type objType, bool allowSceneObjects)
-    {
-        drawingStyle = 10;
-
-        m_LabelStr = label;
-        m_Obj = obj;
-        m_ObjType = objType;
-        m_AllowSceneObjects = allowSceneObjects;
-    }
-
-    public UnityEngine.Object Object
-    {
-        get
-        {
-            return m_Obj;
-        }
-        set
-        {
-            m_Obj = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ObjectField.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/PasswordField.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESPasswordField : UESDisplayObject {
-
-    protected string m_Password;
-    protected int drawingStyle;
-    protected GUIStyle m_Style;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("PasswordField");
-        Password = "123456";
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Password = EditorGUI.PasswordField(m_DrawingRect,m_Password);
-                break;
-
-            case 2:
-                m_Password = EditorGUI.PasswordField(m_DrawingRect, m_Label, m_Password);
-                break;
-
-            case 3:
-                m_Password = EditorGUI.PasswordField(m_DrawingRect,m_Password,m_Style);
-                break;
-
-            case 4:
-                m_Password = EditorGUI.PasswordField(m_DrawingRect,m_LabelStr ,m_Password);
-                break;
-
-            case 5:
-                m_Password = EditorGUI.PasswordField(m_DrawingRect, m_Label, m_Password,m_Style);
-                break;
-
-            case 6:
-                m_Password = EditorGUI.PasswordField(m_DrawingRect, m_LabelStr, m_Password,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public string Password
-    {
-        get
-        {
-            return m_Password;
-        }
-        set
-        {
-            m_Password = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/PasswordField.cs.meta

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

+ 0 - 143
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Popup.cs

@@ -1,143 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESPopup : UESDisplayObject
-{
-    protected GUIContent[] m_DisplayOptions;
-    protected string[] m_StrDisplayOptions;
-    protected int m_SelectIndex;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        var displayOptions = new string[]
-        {
-            "1",
-            "2",
-            "3"
-        };
-        SetDrawingStyle("Popup", displayOptions);
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_SelectIndex, m_DisplayOptions);
-                break;
-
-            case 2:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_SelectIndex, m_StrDisplayOptions);
-                break;
-
-            case 3:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_Label, m_SelectIndex, m_DisplayOptions);
-                break;
-
-            case 4:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_SelectIndex, m_DisplayOptions, m_Style);
-                break;
-
-            case 5:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_SelectIndex, m_StrDisplayOptions, m_Style);
-                break;
-
-            case 6:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_LabelStr, m_SelectIndex, m_StrDisplayOptions);
-                break;
-
-            case 7:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_Label, m_SelectIndex, m_DisplayOptions, m_Style);
-                break;
-
-            case 8:
-                m_SelectIndex = EditorGUI.Popup(m_DrawingRect, m_LabelStr, m_SelectIndex, m_StrDisplayOptions, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent[] displayOptions)
-    {
-        drawingStyle = 1;
-
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(string[] displayOptions)
-    {
-        drawingStyle = 2;
-
-        m_StrDisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIContent[] displayOptions)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(GUIContent[] displayOptions,GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_Style = style;
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(string[] displayOptions, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Style = style;
-        m_StrDisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(string label,string[] displayOptions)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_StrDisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIContent[] displayOptions, GUIStyle style)
-    {
-        drawingStyle = 7;
-
-        m_Label = label;
-        m_Style = style;
-        m_DisplayOptions = displayOptions;
-    }
-
-    public void SetDrawingStyle(string label,string[] displayOptions, GUIStyle style)
-    {
-        drawingStyle = 8;
-
-        m_LabelStr = label;
-        m_Style = style;
-        m_StrDisplayOptions = displayOptions;
-    }
-
-    public int SelectIndex
-    {
-        get
-        {
-            return m_SelectIndex;
-        }
-
-        set
-        {
-            m_SelectIndex = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Popup.cs.meta

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

+ 0 - 40
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ProgressBar.cs

@@ -1,40 +0,0 @@
-using UnityEngine;
-using System.Collections;
-using System;
-using UnityEditor;
-
-public class UESProgressBar : UESDisplayObject
-{
-    protected float m_Value;
-    protected string m_Text;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("ProgressBar");
-        Value=0.3f;
-    }
-
-    public override void OnGUI()
-    {
-        EditorGUI.ProgressBar(m_DrawingRect, m_Value, m_Text);
-    }
-
-    public void SetDrawingStyle(string text)
-    {
-        m_Text = text;
-    }
-
-    public float Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}
-

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ProgressBar.cs.meta

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

+ 0 - 69
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RectField.cs

@@ -1,69 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESRectField : UESDisplayObject
-{
-    protected Rect m_Value;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("RectField");
-        Rect = new Rect(Vector2.zero, new Vector2(INIT_WIDTH, 48));
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.RectField(m_DrawingRect, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.RectField(m_DrawingRect, m_Label, m_Value);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.RectField(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 3;
-
-        m_LabelStr = label;
-    }
-
-    public Rect Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RectField.cs.meta

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

+ 0 - 108
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RepeatButton.cs

@@ -1,108 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESRepeatButton : UESDisplayObject
-{
-    protected bool m_Value;
-    protected Texture m_Image;
-    protected int drawingStyle;
-    protected GUIContent m_Content;
-    protected string m_Text;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("RepeatButton");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = GUI.RepeatButton(m_DrawingRect, m_Content);
-                break;
-
-            case 2:
-                m_Value = GUI.RepeatButton(m_DrawingRect, m_Text);
-                break;
-
-            case 3:
-                m_Value = GUI.RepeatButton(m_DrawingRect, m_Image);
-                break;
-
-            case 4:
-                m_Value = GUI.RepeatButton(m_DrawingRect, m_Content, m_Style);
-                break;
-
-            case 5:
-                m_Value = GUI.RepeatButton(m_DrawingRect, m_Text, m_Style);
-                break;
-
-            case 6:
-                m_Value = GUI.RepeatButton(m_DrawingRect, m_Image, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent content)
-    {
-        drawingStyle = 1;
-
-        m_Content = content;
-    }
-
-    public void SetDrawingStyle(string text)
-    {
-        drawingStyle = 2;
-
-        m_Text = text;
-    }
-
-    public void SetDrawingStyle(Texture image)
-    {
-        drawingStyle = 3;
-
-        m_Image = image;
-    }
-
-    public void SetDrawingStyle(GUIContent content,GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_Content = content;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string text, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Text=text;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(Texture image,GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_Image = image;
-        m_Style = style;
-    }
-
-    public bool Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/RepeatButton.cs.meta

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

+ 0 - 102
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ScrollView.cs

@@ -1,102 +0,0 @@
-using UnityEngine;
-using System.Collections;
-using UnityEditor;
-
-public class UESScrollView : UESDisplayObject
-{
-    protected Vector2 m_ScrollPosition;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        Rect = new Rect(Vector2.zero, new Vector2(INIT_WIDTH, 100));
-    }
-
-    internal override void OnChildrenGUI()
-    {
-        if (Enable)
-        {
-            //渲染自身
-            if (m_Mask != null) GUI.BeginClip(m_DrawingMask, Vector2.zero, Vector2.zero, false);
-            GUI.SetNextControlName(m_Guid);
-            m_Stage.PushToRenderList(this);
-            OnGUI();
-
-            var viewRect = new Rect();
-            if (m_Children.Count>0)
-            {
-                viewRect = m_Children[0].m_Rect;
-                foreach (var child in m_Children)
-                {
-                    viewRect = Rect.MinMaxRect
-                        (
-                        Mathf.Min(viewRect.xMin,child.m_Rect.xMin),
-                        Mathf.Min(viewRect.yMin, child.m_Rect.yMin),
-                        Mathf.Max(viewRect.xMax, child.m_Rect.xMax),
-                        Mathf.Max(viewRect.yMax, child.m_Rect.yMax)
-                        );
-                }
-            }
-            var cacheScrollPosition = m_ScrollPosition;
-            m_ScrollPosition =GUI.BeginScrollView(m_DrawingRect, m_ScrollPosition, viewRect);
-            var offset = cacheScrollPosition - m_ScrollPosition;
-            if (offset != Vector2.zero)
-            {
-                foreach (var child in m_Children)
-                {
-                    var position = new Rect(child.m_Rect.position + offset, child.m_Rect.size);
-                    child.m_Rect = position;
-                }
-                UpdateValues(this);
-            }
-
-            //渲染子物体
-            foreach (var child in m_Children)
-            {
-                if (child.Enable) child.OnChildrenGUI();
-            }
-
-            GUI.EndScrollView();
-            if (m_Mask != null) GUI.EndClip();
-        }
-    }
-
-    public override Rect Rect
-    {
-        get
-        {
-            return base.Rect;
-        }
-
-        set
-        {
-            m_Mask = new Rect(Vector2.zero, value.size);
-            base.Rect = value;
-        }
-    }
-
-    public override Rect? Mask
-    {
-        get
-        {
-            return base.Mask;
-        }
-
-        set
-        {
-            Debug.LogError("此组件暂不支持遮罩!");
-        }
-    }
-
-    public Vector2 ScrollPosition
-    {
-        get
-        {
-            return m_ScrollPosition;
-        }
-        set
-        {
-            m_ScrollPosition = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ScrollView.cs.meta

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

+ 0 - 59
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectableLabel.cs

@@ -1,59 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESSelectableLabel : UESDisplayObject
-{
-    protected string m_Text;
-    protected int drawingStyle;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("This is SelectableLabel...");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                EditorGUI.SelectableLabel(m_DrawingRect, m_Text);
-                break;
-
-            case 2:
-                EditorGUI.SelectableLabel(m_DrawingRect, m_Text,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(string text)
-    {
-        drawingStyle = 1;
-
-        m_Text = text;
-    }
-
-    public void SetDrawingStyle(string text,GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Text = text;
-        m_Style = style;
-    }
-
-    public string Text
-    {
-        get
-        {
-            return m_Text;
-        }
-        set
-        {
-            m_Text = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectableLabel.cs.meta

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

+ 0 - 121
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectionGrid.cs

@@ -1,121 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESSelectionGrid : UESDisplayObject
-{
-    protected int m_Selected;
-    protected int m_XCount;
-    protected GUIContent[] m_Content;
-    protected int drawingStyle;
-    protected string[] m_Texts;
-    protected Texture[] m_Images;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        var texts = new string[]
-        {
-            "1",
-            "2",
-            "3"
-        };
-        SetDrawingStyle(texts, texts.Length);
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Selected = GUI.SelectionGrid(m_DrawingRect, m_Selected, m_Content, m_XCount);
-                break;
-
-            case 2:
-                m_Selected = GUI.SelectionGrid(m_DrawingRect, m_Selected, m_Texts, m_XCount);
-                break;
-
-            case 3:
-                m_Selected = GUI.SelectionGrid(m_DrawingRect, m_Selected, m_Images, m_XCount);
-                break;
-
-            case 4:
-                m_Selected = GUI.SelectionGrid(m_DrawingRect, m_Selected, m_Content, m_XCount,m_Style);
-                break;
-
-            case 5:
-                m_Selected = GUI.SelectionGrid(m_DrawingRect, m_Selected, m_Texts, m_XCount,m_Style);
-                break;
-
-            case 6:
-                m_Selected = GUI.SelectionGrid(m_DrawingRect, m_Selected, m_Images, m_XCount,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent[]content,int xCount)
-    {
-        drawingStyle = 1;
-
-        m_Content = content;
-        m_XCount = xCount;
-    }
-
-    public void SetDrawingStyle(string[] texts, int xCount)
-    {
-        drawingStyle = 2;
-
-        m_Texts = texts;
-        m_XCount = xCount;
-    }
-
-    public void SetDrawingStyle(Texture[] images, int xCount)
-    {
-        drawingStyle = 3;
-
-        m_Images=images;
-        m_XCount = xCount;
-    }
-
-    public void SetDrawingStyle(GUIContent[] content, int xCount,GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_Content = content;
-        m_XCount = xCount;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string[] texts, int xCount, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Texts = texts;
-        m_XCount = xCount;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(Texture[] images, int xCount, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_Images = images;
-        m_XCount = xCount;
-        m_Style = style;
-    }
-
-    public int Selected
-    {
-        get
-        {
-            return m_Selected;
-        }
-        set
-        {
-            m_Selected = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/SelectionGrid.cs.meta

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

+ 0 - 93
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Stage.cs

@@ -1,93 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-/// <summary>
-/// 舞台
-/// </summary>
-public sealed class UESStage : UESDisplayObject
-{
-    private UESDisplayObject m_DragObject;
-    private Vector2 m_DragOffset;
-    private bool m_Repaint;
-    List<UESDisplayObject> m_RenderList;
-
-    protected override void Awake()
-    {
-        base.Awake();
-
-        m_RenderList = new List<UESDisplayObject>();
-        m_Stage = this;
-        m_Depth = -1;
-        m_Rect = new Rect();
-        m_GlobalRect = m_Rect;
-        m_Mask = m_Rect;
-        m_GlobalHitArea = m_Rect;
-    }
-
-    public override void OnGUI()
-    {
-        m_Rect =new Rect(Vector2.zero, m_Window.position.size);
-        m_GlobalRect = m_Rect;
-        m_Mask = m_Rect;
-        m_GlobalHitArea = m_Rect;
-
-        //渲染元素,更新渲染列表
-        m_RenderList.Clear();
-        foreach (var child in m_Children)
-        {
-            child.OnChildrenGUI();
-        }
-
-        if (m_DragObject != null)
-        {
-            var widget = new Rect(Event.current.mousePosition + m_DragOffset, m_DragObject.GlobalRect.size);
-            m_DragObject.GlobalRect = widget;
-        }
-
-        m_Window.Repaint();
-    }
-
-    public override void Update()
-    {
-        //递归调用子物体OnChildrenUpdate方法
-        foreach (var child in m_Children)
-        {
-            child.OnChildrenUpdate();
-        }
-    }
-
-    /// <summary>
-    /// 渲染列表,按照渲染先后顺序排列
-    /// </summary>
-    public List<UESDisplayObject> RenderList { get { return m_RenderList; } }
-    public override int Depth { get { return m_Depth; } set { } }
-    public override UESDisplayObject Parent { get { return null; } }
-    public override Rect? Mask { get { return m_Mask; } set { } }
-    public override Rect Rect { get { return m_Rect; } set { } }
-
-
-    /// <summary>
-    /// 当前拖拽的元素
-    /// </summary>
-    public UESDisplayObject DragObject { get { return m_DragObject; } set { m_DragObject = value; } }
-
-    internal void StartDrag(UESDisplayObject display)
-    {
-        if (display.m_Stage != this || display is UESStage||display==this) return;
-
-        m_DragObject = display;
-        m_DragOffset = display.GlobalRect.position - Event.current.mousePosition;
-    }
-
-    internal void StopDrag(UESDisplayObject display)
-    {
-        if(display==m_DragObject)m_DragObject = null;
-    }
-
-    internal void PushToRenderList(UESDisplayObject display)
-    {
-        m_RenderList.Add(display);
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Stage.cs.meta

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

+ 0 - 104
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TagField.cs

@@ -1,104 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESTagField : UESDisplayObject
-{
-    protected string m_Tag;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("TagField");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Tag = EditorGUI.TagField(m_DrawingRect, m_Tag);
-                break;
-
-            case 2:
-                m_Tag = EditorGUI.TagField(m_DrawingRect,m_Label, m_Tag);
-                break;
-
-            case 3:
-                m_Tag = EditorGUI.TagField(m_DrawingRect, m_Tag,m_Style);
-                break;
-
-            case 4:
-                m_Tag = EditorGUI.TagField(m_DrawingRect, m_LabelStr, m_Tag);
-                break;
-
-            case 5:
-                m_Tag = EditorGUI.TagField(m_DrawingRect, m_Label, m_Tag,m_Style);
-                break;
-
-            case 6:
-                m_Tag = EditorGUI.TagField(m_DrawingRect, m_LabelStr, m_Tag,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label,GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label,GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public string Tag
-    {
-        get
-        {
-            return m_Tag;
-        }
-        set
-        {
-            m_Tag = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TagField.cs.meta

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

+ 0 - 58
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextArea.cs

@@ -1,58 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESTextArea : UESDisplayObject
-{
-    protected string m_Text;
-    protected int drawingStyle;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle();
-        Text = "This is TextArea...";
-        Rect = new Rect(Vector2.zero,new Vector2(INIT_WIDTH,48));
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Text = EditorGUI.TextArea(m_DrawingRect, m_Text);
-                break;
-
-            case 2:
-                m_Text = EditorGUI.TextArea(m_DrawingRect, m_Text,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Style = style;
-    }
-
-    public string Text
-    {
-        get
-        {
-            return m_Text;
-        }
-        set
-        {
-            m_Text = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextArea.cs.meta

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

+ 0 - 105
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextField.cs

@@ -1,105 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESTextField : UESDisplayObject
-{
-    protected string m_Text;
-    protected int drawingStyle;
-    protected GUIStyle m_Style;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("TextField");
-        Text = "This is TextField...";
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Text = EditorGUI.TextField(m_DrawingRect, m_Text);
-                break;
-
-            case 2:
-                m_Text = EditorGUI.TextField(m_DrawingRect,m_Label ,m_Text);
-                break;
-
-            case 3:
-                m_Text = EditorGUI.TextField(m_DrawingRect, m_Text,m_Style);
-                break;
-
-            case 4:
-                m_Text = EditorGUI.TextField(m_DrawingRect, m_LabelStr, m_Text);
-                break;
-
-            case 5:
-                m_Text = EditorGUI.TextField(m_DrawingRect, m_Label, m_Text,m_Style);
-                break;
-
-            case 6:
-                m_Text = EditorGUI.TextField(m_DrawingRect, m_LabelStr, m_Text, m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label,GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public string Text
-    {
-        get
-        {
-            return m_Text;
-        }
-        set
-        {
-            m_Text = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/TextField.cs.meta

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

+ 0 - 101
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Texture.cs

@@ -1,101 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-[Serializable]
-/// <summary>
-/// 绘制图片
-/// </summary>
-public class UESTexture : UESDisplayObject
-{
-    protected Texture m_Image;
-    protected ScaleMode m_ScaleMode;
-    protected bool m_AlphaBlend;
-    protected float m_ImageAspect;
-    protected int drawingStyle;
-    protected Rect m_TexCoords;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        m_Image = UESTool.GetTexture("DefaultTexture");
-        Rect = new Rect(Vector2.zero, new Vector2(INIT_WIDTH, 32));
-        SetDrawingStyle(ScaleMode.StretchToFill,true,1);
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                GUI.DrawTexture(m_DrawingRect, m_Image);
-                break;
-
-            case 2:
-                GUI.DrawTexture(m_DrawingRect,m_Image,m_ScaleMode);
-                break;
-
-            case 3:
-                GUI.DrawTexture(m_DrawingRect, m_Image, m_ScaleMode, m_AlphaBlend);
-                break;
-
-            case 4:
-                GUI.DrawTexture(m_DrawingRect, m_Image, m_ScaleMode, m_AlphaBlend, m_ImageAspect);
-                break;
-
-            case 5:
-                GUI.DrawTextureWithTexCoords(m_DrawingRect, m_Image, m_TexCoords);
-                break;
-
-            case 6:
-                GUI.DrawTextureWithTexCoords(m_DrawingRect, m_Image, m_TexCoords,m_AlphaBlend);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(ScaleMode scaleMode)
-    {
-        drawingStyle = 2;
-
-        m_ScaleMode = scaleMode;
-    }
-
-    public void SetDrawingStyle(ScaleMode scaleMode,bool alphaBlend)
-    {
-        drawingStyle = 3;
-
-        m_ScaleMode = scaleMode;
-        m_AlphaBlend = alphaBlend;
-    }
-
-    public void SetDrawingStyle(ScaleMode scaleMode, bool alphaBlend,float imageAspect)
-    {
-        drawingStyle = 4;
-
-        m_ScaleMode = scaleMode;
-        m_AlphaBlend = alphaBlend;
-        m_ImageAspect = imageAspect;
-    }
-
-    public void SetDrawingStyle(Rect texCoords)
-    {
-        drawingStyle = 5;
-
-        m_TexCoords = texCoords;
-    }
-
-    public void SetDrawingStyle(Rect texCoords,bool alphaBlend)
-    {
-        drawingStyle = 6;
-
-        m_TexCoords = texCoords;
-        m_AlphaBlend = alphaBlend;
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Texture.cs.meta

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

+ 0 - 104
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toggle.cs

@@ -1,104 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESToggle : UESDisplayObject
-{
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected GUIStyle m_Style;
-    protected bool m_Value;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("Toggle");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.Toggle(m_DrawingRect, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.Toggle(m_DrawingRect, m_Value,m_Style);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.Toggle(m_DrawingRect, m_Label, m_Value);
-                break;
-
-            case 4:
-                m_Value = EditorGUI.Toggle(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-
-            case 5:
-                m_Value = EditorGUI.Toggle(m_DrawingRect, m_Label, m_Value,m_Style);
-                break;
-
-            case 6:
-                m_Value = EditorGUI.Toggle(m_DrawingRect, m_LabelStr, m_Value,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIStyle style)
-    {
-        drawingStyle = 2;
-
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public bool Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toggle.cs.meta

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

+ 0 - 100
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ToggleLeft.cs

@@ -1,100 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESToggleLeft : UESDisplayObject
-{
-    public const int HEIGHT = 18;
-
-    protected bool m_Value;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-    protected string m_LabelStr;
-    protected GUIStyle m_Style;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle("ToggleLeft");
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Value = EditorGUI.ToggleLeft(m_DrawingRect, m_Label, m_Value);
-                break;
-
-            case 2:
-                m_Value = EditorGUI.ToggleLeft(m_DrawingRect, m_LabelStr, m_Value);
-                break;
-
-            case 3:
-                m_Value = EditorGUI.ToggleLeft(m_DrawingRect, m_Label, m_Value,m_Style);
-                break;
-
-            case 4:
-                m_Value = EditorGUI.ToggleLeft(m_DrawingRect, m_LabelStr, m_Value,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 1;
-
-        m_Label = label;
-    }
-
-    public void SetDrawingStyle(string label)
-    {
-        drawingStyle = 2;
-
-        m_LabelStr = label;
-    }
-
-    public void SetDrawingStyle(GUIContent label, GUIStyle style)
-    {
-        drawingStyle = 3;
-
-        m_Label = label;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string label, GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_LabelStr = label;
-        m_Style = style;
-    }
-
-    public override Rect Rect
-    {
-        get
-        {
-            return base.Rect;
-        }
-
-        set
-        {
-            value = new Rect(value.position,new Vector2(value.width, HEIGHT));
-            base.Rect = value;
-        }
-    }
-
-    public bool Value
-    {
-        get
-        {
-            return m_Value;
-        }
-        set
-        {
-            m_Value = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/ToggleLeft.cs.meta

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

+ 0 - 114
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toolbar.cs

@@ -1,114 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESToolbar : UESDisplayObject
-{
-    protected int m_Selected;
-    protected GUIContent[] m_Content;
-    protected Texture[] m_Images;
-    protected string[] m_Texts;
-    protected GUIStyle m_Style;
-    protected int drawingStyle;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        var texts = new string[]
-        {
-            "1",
-            "2",
-            "3"
-        };
-        SetDrawingStyle(texts);
-    }
-
-    public override void OnGUI()
-    {
-        switch (drawingStyle)
-        {
-            case 1:
-                m_Selected = GUI.Toolbar(m_DrawingRect, m_Selected, m_Content);
-                break;
-
-            case 2:
-                m_Selected = GUI.Toolbar(m_DrawingRect, m_Selected, m_Texts);
-                break;
-
-            case 3:
-                m_Selected = GUI.Toolbar(m_DrawingRect, m_Selected, m_Images);
-                break;
-
-            case 4:
-                m_Selected = GUI.Toolbar(m_DrawingRect, m_Selected, m_Content,m_Style);
-                break;
-
-            case 5:
-                m_Selected = GUI.Toolbar(m_DrawingRect, m_Selected, m_Texts,m_Style);
-                break;
-
-            case 6:
-                m_Selected = GUI.Toolbar(m_DrawingRect, m_Selected, m_Images,m_Style);
-                break;
-        }
-    }
-
-    public void SetDrawingStyle(GUIContent[] content)
-    {
-        drawingStyle = 1;
-
-        m_Content = content;
-    }
-
-    public void SetDrawingStyle(string[] texts)
-    {
-        drawingStyle = 2;
-
-        m_Texts = texts;
-    }
-
-    public void SetDrawingStyle(Texture[] images)
-    {
-        drawingStyle = 3;
-
-        m_Images = images;
-    }
-
-    public void SetDrawingStyle(GUIContent[] content,GUIStyle style)
-    {
-        drawingStyle = 4;
-
-        m_Content = content;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(string[] texts, GUIStyle style)
-    {
-        drawingStyle = 5;
-
-        m_Texts = texts;
-        m_Style = style;
-    }
-
-    public void SetDrawingStyle(Texture[] images, GUIStyle style)
-    {
-        drawingStyle = 6;
-
-        m_Images = images;
-        m_Style = style;
-    }
-
-    public int Selected
-    {
-        get
-        {
-            return m_Selected;
-        }
-        set
-        {
-            m_Selected = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Toolbar.cs.meta

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

+ 0 - 197
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBezier.cs

@@ -1,197 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEditor;
-
-/// <summary>
-/// 绘制贝塞尔曲线
-/// </summary>
-public class UESBezier : UESDisplayObject
-{
-    const float TANGENT_LENGTH = 0.3f;                                          //操控轴占百分比
-    const float HIT_WIDTH_MIN = 10f;                                            //线的最小碰撞宽度
-
-    protected Vector2[] m_Points;
-    protected UESBezierPointData[] bezierPoints;
-    protected UESBezierPointData[] globalBezierPoints;
-    protected UESBezierPointData[] drawingBezierPoints;
-    protected Color m_Color;
-    protected float m_Width = 1;                                                //宽
-    protected Texture2D m_Texture;                                              //位图纹理
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle(Color.white, null, 1);
-        Points = new Vector2[]
-        {
-            new Vector2(0,0),
-            new Vector2(150,30),
-            new Vector2(300,0)
-        };
-    }
-
-    public override void OnGUI()
-    {
-        base.OnGUI();
-
-        Handles.BeginGUI();
-        Handles.color = m_Color;
-        if (bezierPoints!=null)
-        {
-            foreach (var point in drawingBezierPoints)
-            {
-                Handles.DrawBezier(point.startPosition, point.endPosition, point.startTangent, point.endTangent, m_Color, m_Texture,m_Width);
-            }
-        }
-        Handles.EndGUI();
-    }
-
-    public void SetDrawingStyle(Color color,Texture2D texture,float width)
-    {
-        m_Color = color;
-        m_Texture = texture;
-        m_Width = width;
-    }
-
-    public override Rect Rect
-    {
-        get
-        {
-            return base.Rect;
-        }
-
-        set
-        {
-            if (m_Points == null)
-            {
-                //Debug.Log("直接设置Points");
-                return;
-            }
-
-            var containsPointRect = UESTool.GetContainsPointsRect(m_Points);
-            var offset = value.position - containsPointRect.position;
-            for (var i = 0; i < m_Points.Length; i++)
-            {
-                m_Points[i] = new Vector2(m_Points[i].x + offset.x, m_Points[i].y + offset.y);
-            }
-            Points = m_Points;
-        }
-    }
-
-    /// <summary>
-    /// 关键点
-    /// 使用父容器坐标
-    /// </summary>
-    public Vector2[] Points
-    {
-        get
-        {
-            return m_Points;
-        }
-        set
-        {
-            if (value == null||value.Length<2)
-            {
-                Debug.LogError("m_Points不能为空,且点数量>=2");
-                return;
-            }
-
-            m_Points = value;
-            m_Rect = UESTool.GetContainsPointsRect(m_Points);
-            UpdateValues(m_Parent);
-        }
-    }
-
-    protected override void UpdateSelf()
-    {
-        if (m_Points == null || m_Points.Length < 3) return;
-
-        var last = m_Points.Length - 1;
-        Queue<Vector2> tangentQueue = new Queue<Vector2>();
-        bezierPoints = new UESBezierPointData[last];
-
-        for (var i = 0; i < m_Points.Length; i++)
-        {
-            if (i == 0) { tangentQueue.Enqueue(m_Points[0]); continue; }
-            if (i == last) { tangentQueue.Enqueue(m_Points[last]); continue; }
-
-            Vector3 currentPoint = m_Points[i];
-            Vector3 pevPoint = m_Points[i - 1];
-            Vector3 nextPoint = m_Points[i + 1];
-
-            var sidePev = pevPoint - currentPoint;
-            var sideNext = nextPoint - currentPoint;
-            var median = Vector3.Lerp(sidePev, sideNext, 0.5f);     //中线
-
-            var sidePevCross = Vector3.Cross(median, sidePev);
-            var sidePevTangent = Vector3.Cross(sidePevCross, median).normalized * Vector3.Distance(pevPoint, currentPoint) * TANGENT_LENGTH + currentPoint;
-            var sideNextCross = Vector3.Cross(median, sideNext);
-            var sideNextTangent = Vector3.Cross(sideNextCross, median).normalized * Vector3.Distance(nextPoint, currentPoint) * TANGENT_LENGTH + currentPoint;
-
-            tangentQueue.Enqueue(sidePevTangent);
-            tangentQueue.Enqueue(sideNextTangent);
-        }
-
-        for (var i = 0; i < last; i++)
-        {
-            bezierPoints[i] = new UESBezierPointData(m_Points[i], m_Points[i + 1], tangentQueue.Dequeue(), tangentQueue.Dequeue());
-        }
-
-        globalBezierPoints = new UESBezierPointData[bezierPoints.Length];
-        for (var i = 0; i < globalBezierPoints.Length; i++)
-        {
-            var globalOffset = Local2Global(m_Parent, bezierPoints[i].startPosition) - bezierPoints[i].startPosition;
-            var globalBezierPoint = bezierPoints[i];
-            globalBezierPoint.startPosition += globalOffset;
-            globalBezierPoint.endPosition += globalOffset;
-            globalBezierPoint.startTangent += globalOffset;
-            globalBezierPoint.endTangent += globalOffset;
-            globalBezierPoints[i] = globalBezierPoint;
-        }
-
-        drawingBezierPoints = new UESBezierPointData[bezierPoints.Length];
-        var offset = m_DrawingRect.position - UESTool.GetContainsPointsRect(m_Points).position;
-        for (var i = 0; i < drawingBezierPoints.Length; i++)
-        {
-            var point = bezierPoints[i];
-            point.startPosition += offset;
-            point.endPosition += offset;
-            point.startTangent += offset;
-            point.endTangent += offset;
-            drawingBezierPoints[i] = point;
-        }
-    }
-
-    public override bool IsHit(Vector2 globalPoint)
-    {
-        foreach (var point in globalBezierPoints)
-        {
-            var dist = HandleUtility.DistancePointBezier(globalPoint, point.startPosition, point.endPosition, point.startTangent, point.endTangent);
-            if (dist < HIT_WIDTH_MIN)
-            {
-                return true;
-            }
-        }
-
-        return false;
-    }
-}
-
-[System.Serializable]
-public struct UESBezierPointData
-{
-    public Vector2 startPosition;
-    public Vector2 endPosition;
-    public Vector2 startTangent;
-    public Vector2 endTangent;
-
-    public UESBezierPointData(Vector2 startPosition, Vector2 endPosition, Vector2 startTangent, Vector2 endTangent)
-    {
-        this.startPosition = startPosition;
-        this.endPosition = endPosition;
-        this.startTangent = startTangent;
-        this.endTangent = endTangent;
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBezier.cs.meta

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

+ 0 - 61
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBoundsField.cs

@@ -1,61 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-
-public class UESBoundsField : UESDisplayObject
-{
-    protected Bounds bounds;
-    protected int drawingStyle;
-    protected GUIContent m_Label;
-
-    protected override void Awake()
-    {
-        base.Awake();
-        SetDrawingStyle(new GUIContent("BoundField"));
-        Rect = new Rect(Vector2.zero, new Vector2(INIT_WIDTH, 48));
-    }
-
-    public override void OnGUI()
-    {
-        base.OnGUI();
-        switch (drawingStyle)
-        {
-            case 1:
-                bounds = EditorGUI.BoundsField(m_DrawingRect, bounds);
-                break;
-
-            case 2:
-                bounds = EditorGUI.BoundsField(m_DrawingRect, m_Label, bounds);
-                break;
-        }
-    }
-
-    public void SerDrawingStyle()
-    {
-        drawingStyle = 1;
-    }
-
-    public void SetDrawingStyle(GUIContent label)
-    {
-        drawingStyle = 2;
-
-        m_Label = label;
-    }
-
-    /// <summary>
-    /// Bounds值
-    /// </summary>
-    public Bounds Bounds
-    {
-        get
-        {
-            return bounds;
-        }
-        set
-        {
-            bounds = value;
-        }
-    }
-}

+ 0 - 12
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBoundsField.cs.meta

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

Некоторые файлы не были показаны из-за большого количества измененных файлов