/// <summary> /// 用于显示鼠标检测到的事件 /// 范围5*10 /// </summary> public static GameObject GetMouseEventUI(Vector2 pos) { TextBox textBox = UIFactroy.CreateTextBox(pos, 5, 10); textBox.AddComponent <MouseEventBox>(); return(textBox.GameObject); }
/// <summary> /// 系统监视器.包含常见的系统信息,范围17*12 /// </summary> public static GameObject GetSystemInspector(Vector2 pos) { TextBox textBox = UIFactroy.CreateTextBox(pos, 15, 10); SystemInspector script = textBox.AddComponent <SystemInspector>(); return(textBox.GameObject); }
/// <summary> /// 显示系统中各个系统耗时 /// 范围14*17 /// </summary> public static GameObject GetTimerUI(Vector2 pos, int interval = 10) { TextBox textBox = UIFactroy.CreateTextBox(pos, 12, 15); TimerBox script = textBox.AddComponent <TimerBox>(); script.Interval = interval; return(textBox.GameObject); }
/// <summary> /// 初始化Editor,创建Editor对应的UI对象 /// </summary> public static void EditorInit() { CoordsBox debugUIBox = CreateDebugUIBox(RendererSystem.cameraStartPos + new Vector2Int(-1, 0) + new Vector2Int(0, -Camera.main.Height), Camera.main.Height + 2, Camera.main.Width + 2); Label label = UIFactroy.CreateLabel(new Vector2Int(15, 0), "DESTROY ENGINE Debug Mode", 13); label.GetComponent <Renderer>().inDebug = true; label.GetComponent <Renderer>().Material = new Material(EngineColor.Red, EngineColor.Black); debugUIBox.OnSetCamera(Camera.main.transform.Position); }