public void Centre_InitialiseMap(HighLightMode mode) { for (int count = 0; count < 12; count++) { Centre_HighlightMap(count, mode); } }
/// <summary> /// Graphical highlighting /// </summary> public void SetHighlight(HighLightMode mode) { if (mHighlight == mode) { return; } mHighlight = mode; // TODO - reenable this. }
void CompleteDrag() { Higlight = HighLightMode.None; var editor = PEExposedPropertiesEditor.current; DragAndDrop.AcceptDrag(); EditorApplication.delayCall += () => { editor.Build(true); EditorApplication.RepaintHierarchyWindow(); }; editor.needRebuild = editor.needRepaint = true; }
public void Centre_HighlightMap(int region, HighLightMode mode) { Color to = Color.white; switch (mode) { case HighLightMode.Darken: to = new Color(0.4f, 0.4f, 0.4f); break; case HighLightMode.Lighten: to = Color.white; break; case HighLightMode.Reden: to = Color.red; break; } centre_MapT.GetChild(region).GetComponent <Image>().color = to; }
void UpdateDrag(Rect rect) { if (Event.current.type == EventType.DragUpdated || Event.current.type == EventType.DragExited) Higlight = HighLightMode.None; if (Event.current.type == EventType.layout) return; DrawHighlight(rect); var testRect = rect; testRect.height += 2; if (!testRect.Contains(Event.current.mousePosition)) return; var dragData = DragAndDrop.GetGenericData("ExposedProperty") as ItemDrawer; if (Event.current.type != EventType.MouseDrag && (dragData == this || dragData != null && dragData.IsParentOf(this))) return; switch (Event.current.type) { case EventType.MouseDrag: if (!this.Inherited) { GUI.FocusControl(""); DragAndDrop.PrepareStartDrag(); DragAndDrop.SetGenericData("ExposedProperty", this); DragAndDrop.paths = new[] { " " }; DragAndDrop.StartDrag(this.Label.text); } break; case EventType.DragUpdated: DragAndDrop.visualMode = dragData == this ? DragAndDropVisualMode.None : DragAndDropVisualMode.Copy; Higlight = IsGroup && Mathf.Abs(Event.current.mousePosition.y - rect.center.y) < 6 ? HighLightMode.Current : Event.current.mousePosition.y > rect.center.y ? HighLightMode.After : HighLightMode.Before; if (this.Parent != null && this.Higlight != HighLightMode.Current) this.Parent.Higlight = HighLightMode.Current; PEExposedPropertiesEditor.current.needRepaint = true; break; case EventType.DragPerform: var dragExposedData = dragData.ExposedData.First(); var addToCurrent = IsGroup && Higlight == HighLightMode.Current; dragExposedData.ParentId = addToCurrent ? this.ExposedData.First().Id : this.ExposedData.First().ParentId; if (!addToCurrent) dragExposedData.Order = this.ExposedData.First().GetOrder(Higlight == HighLightMode.After); CompleteDrag(); break; } }
void UpdateDrag(Rect rect) { if (Event.current.type == EventType.DragUpdated || Event.current.type == EventType.DragExited) { Higlight = HighLightMode.None; } if (Event.current.type == EventType.layout) { return; } DrawHighlight(rect); var testRect = rect; testRect.height += 2; if (!testRect.Contains(Event.current.mousePosition)) { return; } var dragData = DragAndDrop.GetGenericData("ExposedProperty") as ItemDrawer; if (Event.current.type != EventType.MouseDrag && (dragData == this || dragData != null && dragData.IsParentOf(this))) { return; } switch (Event.current.type) { case EventType.MouseDrag: if (!this.Inherited) { GUI.FocusControl(""); DragAndDrop.PrepareStartDrag(); DragAndDrop.SetGenericData("ExposedProperty", this); DragAndDrop.paths = new[] { " " }; DragAndDrop.StartDrag(this.Label.text); } break; case EventType.DragUpdated: DragAndDrop.visualMode = dragData == this ? DragAndDropVisualMode.None : DragAndDropVisualMode.Copy; Higlight = IsGroup && Mathf.Abs(Event.current.mousePosition.y - rect.center.y) < 6 ? HighLightMode.Current : Event.current.mousePosition.y > rect.center.y ? HighLightMode.After : HighLightMode.Before; if (this.Parent != null && this.Higlight != HighLightMode.Current) { this.Parent.Higlight = HighLightMode.Current; } PEExposedPropertiesEditor.current.needRepaint = true; break; case EventType.DragPerform: var dragExposedData = dragData.ExposedData.First(); var addToCurrent = IsGroup && Higlight == HighLightMode.Current; dragExposedData.ParentId = addToCurrent ? this.ExposedData.First().Id : this.ExposedData.First().ParentId; if (!addToCurrent) { dragExposedData.Order = this.ExposedData.First().GetOrder(Higlight == HighLightMode.After); } CompleteDrag(); break; } }
public void Centre_HighlightMap(string region, HighLightMode mode) { Centre_HighlightMap(Helper.ConvertRegionNameToID(region), mode); }