protected override void OnClick(SWSlot item, Vector2 mp) { base.OnClick(item, mp); SWUndo.Record(this); selection = slots.IndexOf(item); delegat(item, mp); }
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; } } }
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(); } }
void OnSelect(SWSlot slot, Vector2 mp) { }
protected virtual void OnClick(SWSlot item, Vector2 mp) { }
protected override void OnClick(SWSlot item, Vector2 mp) { base.OnClick(item, mp); moving = item; }
public override void Init(System.Action <SWSlot, Vector2> _delegat) { base.Init(_delegat); moving = null; }
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); }