Exemplo n.º 1
0
 protected override void OnClick(SWSlot item, Vector2 mp)
 {
     base.OnClick(item, mp);
     SWUndo.Record(this);
     selection = slots.IndexOf(item);
     delegat(item, mp);
 }
Exemplo n.º 2
0
        public override void OnGUI()
        {
            base.OnGUI();
            Vector2 mp = Event.current.mousePosition;

            if (moving != null && !string.IsNullOrEmpty(moving.name))
            {
                Rect rect = new Rect(mp.x - dragBoxSizeX * 0.5f, mp.y - dragBoxSizeY * 0.5f, dragBoxSizeX, dragBoxSizeY);

//				SWCustomStyle style = (SWCustomStyle)System.Enum.Parse (typeof(SWCustomStyle),"eTool" + moving.styleID);
//				SWCustomStyle styleDrag = (SWCustomStyle)System.Enum.Parse (typeof(SWCustomStyle),"eToolDrag" + moving.styleID);
//				SWCustomStyle styleDown = (SWCustomStyle)System.Enum.Parse (typeof(SWCustomStyle),"eToolDown" + moving.styleID);

                GUI.Box(rect, "", moving.StyleDrag);
                GUI.Label(rect, moving.name, SWEditorUI.Style_Get(SWCustomStyle.eTxtLight));



                if (Event.current.type == EventType.mouseUp)
                {
                    if (regionTarget.Contains(mp))
                    {
                        Vector2 posInRect = mp;
                        delegat(moving, posInRect);
                    }
                    moving = null;
                }
            }
        }
Exemplo n.º 3
0
        public override void OnGUI()
        {
            base.OnGUI();
            Vector2 mp = Event.current.mousePosition;

            if (moving != null && !string.IsNullOrEmpty(moving.name))
            {
                Rect rect = new Rect(mp.x - dragBoxSizeX * 0.5f, mp.y - dragBoxSizeY * 0.5f, dragBoxSizeX, dragBoxSizeY);

                GUI.Box(rect, "", moving.StyleDrag);
                GUI.Label(rect, moving.name, SWEditorUI.Style_Get(SWCustomStyle.eTxtLight));

                if (Event.current.type == EventType.MouseUp)
                {
                    if (regionTarget.Contains(mp))
                    {
                        Vector2 posInRect = mp;
                        delegat(moving, posInRect);
                    }
                    moving = null;
                }
                RepaintGetDirty();
            }
        }
Exemplo n.º 4
0
 void OnSelect(SWSlot slot, Vector2 mp)
 {
 }
 protected virtual void OnClick(SWSlot item, Vector2 mp)
 {
 }
Exemplo n.º 6
0
 protected override void OnClick(SWSlot item, Vector2 mp)
 {
     base.OnClick(item, mp);
     moving = item;
 }
Exemplo n.º 7
0
 public override void Init(System.Action <SWSlot, Vector2> _delegat)
 {
     base.Init(_delegat);
     moving = null;
 }
Exemplo n.º 8
0
 void OnSelect(SWSlot slot, Vector2 mp)
 {
     rData.mode = (DrawRemapMode)slotBox_left.selection;
 }
 protected override void OnClick(SWSlot item, Vector2 mp)
 {
     base.OnClick(item, mp);
     delegat(item, mp);
 }