public void DrawOverlayInstruction() { #if UNITY_EDITOR Vector2 guiSize = new Vector2(200, 85); Vector2 guiPosition = new Vector2(Screen.width - guiSize.x, Screen.height - guiSize.y); Rect r = new Rect(guiPosition, guiSize); Handles.BeginGUI(); GUILayout.BeginArea(r); string tabText = GuiEventUtilities.IsButtonPressed(KeyCode.Tab) ? "<b>Tab</b>" : "Tab"; string shiftText = GuiEventUtilities.IsShift ? "<b>Shift</b>" : "Shift"; string ctrlText = GuiEventUtilities.IsCtrl ? "<b>Ctrl</b>" : "Ctrl"; string instruction = string.Format( "Press {0} to switch brush mode\n" + "Hold {1} to smooth terrain\n" + "Hold {2} to lower terrain", tabText, shiftText, ctrlText); GUILayout.Box(instruction, GuiStyleUtilities.OverlayInstructionStyle); GUILayout.EndArea(); Handles.EndGUI(); #endif }
public void DrawOverlayInstruction() { #if UNITY_EDITOR Vector2 guiSize = new Vector2(200, 87); Vector2 guiPosition = new Vector2(Screen.width - guiSize.x, Screen.height - guiSize.y); Rect r = new Rect(guiPosition, guiSize); Handles.BeginGUI(); GUILayout.BeginArea(r); string tabText = GuiEventUtilities.IsButtonPressed(KeyCode.Tab) ? "<b>Tab</b>" : "Tab"; string modeText = Settings.mode == Mode.Spawning ? "Mask" : "Spawn"; string shiftText = GuiEventUtilities.IsShift ? "<b>Shift</b>" : "Shift"; string ctrlText = GuiEventUtilities.IsCtrl ? "<b>Ctrl</b>" : "Ctrl"; string instruction = string.Format( "Press {0} to enter {1} mode\n" + "Hold {2} to follow normals\n" + "Hold {3} to erase\n", tabText, modeText, shiftText, ctrlText); GUILayout.Box(instruction, GuiStyleUtilities.OverlayInstructionStyle); GUILayout.EndArea(); Handles.EndGUI(); #endif }