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

加入一个扩展编辑器开发库RedScarf

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

+ 9 - 0
Unity/Assets/RedScarf.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 3dc598035dd0e374d8d2041fb4b6ad18
+folderAsset: yes
+timeCreated: 1497865596
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

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

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

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

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

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

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

@@ -0,0 +1,95 @@
+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);
+    }
+}

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

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

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

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

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

@@ -0,0 +1,98 @@
+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;
+    }
+}

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

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

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

@@ -0,0 +1,89 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,133 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,427 @@
+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);
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,61 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,136 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,29 @@
+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;
+    }
+}

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

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

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

@@ -0,0 +1,66 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,72 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,186 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,120 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,123 @@
+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;
+    }
+}

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

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

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

@@ -0,0 +1,104 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,128 @@
+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;
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,119 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,141 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,143 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,40 @@
+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;
+        }
+    }
+}
+

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

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

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

@@ -0,0 +1,69 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,108 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,102 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,59 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,121 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,93 @@
+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);
+    }
+}

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

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

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

@@ -0,0 +1,104 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,58 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,105 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,101 @@
+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;
+    }
+}

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

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

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

@@ -0,0 +1,104 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,100 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,114 @@
+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;
+        }
+    }
+}

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

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

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

@@ -0,0 +1,197 @@
+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;
+    }
+}

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

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

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

@@ -0,0 +1,61 @@
+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;
+        }
+    }
+}

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

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

+ 109 - 0
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/UESBox.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+
+public class UESBox : 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("Box");
+        Rect = new Rect(Vector2.zero,new Vector2(INIT_WIDTH,32));
+    }
+
+    public override void OnGUI()
+    {
+        base.OnGUI();
+        switch (drawingStyle)
+        {
+            case 1:
+                GUI.Box(m_DrawingRect, m_Content);
+                break;
+
+            case 2:
+                GUI.Box(m_DrawingRect, m_Text);
+                break;
+
+            case 3:
+                GUI.Box(m_DrawingRect, m_Image);
+                break;
+
+            case 4:
+                GUI.Box(m_DrawingRect, m_Content,m_Style);
+                break;
+
+            case 5:
+                GUI.Box(m_DrawingRect, m_Text,m_Style);
+                break;
+
+            case 6:
+                GUI.Box(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 string Text
+    {
+        get
+        {
+            return m_Text;
+        }
+        set
+        {
+            m_Text = value;
+        }
+    }
+}

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

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

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

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

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

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

+ 62 - 0
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Vector3Field.cs

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

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

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

+ 62 - 0
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/Vector4Field.cs

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

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

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

+ 67 - 0
Unity/Assets/RedScarf/UnityEditorScript/Editor/Display/VerticalSlider.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+public class UESVerticalSlider : UESDisplayObject
+{
+    protected float m_Value;
+    protected float m_TopValue;
+    protected float m_BottomValue;
+    protected int drawingStyle;
+    protected GUIStyle m_Slider;
+    protected GUIStyle m_Thumb;
+
+    protected override void Awake()
+    {
+        base.Awake();
+        SetDrawingStyle(0, 100);
+        Value = 30;
+        Rect = new Rect(Vector2.zero, new Vector2(INIT_WIDTH, INIT_HEIGHT*2));
+    }
+
+    public override void OnGUI()
+    {
+        switch (drawingStyle)
+        {
+            case 1:
+                m_Value = GUI.VerticalSlider(m_DrawingRect, m_Value, m_TopValue, m_BottomValue);
+                break;
+
+            case 2:
+                m_Value = GUI.VerticalSlider(m_DrawingRect, m_Value, m_TopValue, m_BottomValue,m_Slider,m_Thumb);
+                break;
+        }
+    }
+
+    public void SetDrawingStyle(float topValue,float bottomValue)
+    {
+        drawingStyle = 1;
+
+        m_TopValue = topValue;
+        m_BottomValue = bottomValue;
+    }
+
+    public void SetDrawingStyle(float topValue, float bottomValue,GUIStyle slider,GUIStyle thumb)
+    {
+        drawingStyle = 2;
+
+        m_TopValue = topValue;
+        m_BottomValue = bottomValue;
+        m_Slider = slider;
+        m_Thumb = thumb;
+    }
+
+    public float Value
+    {
+        get
+        {
+            return m_Value;
+        }
+        set
+        {
+            m_Value = value;
+        }
+    }
+}

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

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

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

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

+ 71 - 0
Unity/Assets/RedScarf/UnityEditorScript/Editor/Event/DragAndDropEvent.cs

@@ -0,0 +1,71 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+public class UESDragAndDropEvent : UESEvent {
+
+    public const string DRAG_PERFORM = "DragPerform";
+    public const string DRAG_UPDATED = "DragUpdated";
+    public const string DRAG_EXITED  = "DragExited";
+    public const string DRAG_ENTER   = "DragEnter";
+
+    public int activeControlID;
+    public Object[] objectReferences;
+    public string[] paths;
+
+    protected enum DragSteps
+    {
+        Enter,
+        Update,
+        Perform,
+        Exit
+    }
+    protected DragSteps dragStep;
+
+    public UESDragAndDropEvent(UESObject target, string type, System.Action<UESEvent> callback) 
+        : base(target, type, callback)
+    {
+    }
+
+    public override void OnGUI()
+    {
+        var display = m_CurrentTarget as UESDisplayObject;
+        if (display == null) return;
+
+        base.OnGUI();
+
+        activeControlID = DragAndDrop.activeControlID;
+        objectReferences = DragAndDrop.objectReferences;
+        paths = DragAndDrop.paths;
+
+        if (Event.current.type == EventType.DragExited)
+        {
+            dragStep = DragSteps.Exit;
+            if(m_Type == DRAG_EXITED) Invoke();
+        }
+
+        if (!display.GlobalHitArea.Contains(Event.current.mousePosition)) return;
+
+        switch (Event.current.type)
+        {
+            case EventType.DragPerform:
+                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
+                DragAndDrop.AcceptDrag();
+                dragStep = DragSteps.Perform;
+                if (m_Type == DRAG_PERFORM) Invoke();
+                break;
+
+            case EventType.DragUpdated:
+                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
+                if (m_Type == DRAG_ENTER && dragStep != DragSteps.Update)
+                {
+                    dragStep = DragSteps.Enter;
+                    Invoke();
+                }
+                dragStep = DragSteps.Update;
+                if (m_Type == DRAG_UPDATED&& dragStep == DragSteps.Update) Invoke();
+                break;
+        }
+    }
+}

+ 12 - 0
Unity/Assets/RedScarf/UnityEditorScript/Editor/Event/DragAndDropEvent.cs.meta

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

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