8 public static class InterfaceMaker
11 private static Texture2D _boxBackground;
12 private static Texture2D _winBackground;
13 private static GUISkin _customSkin;
15 public static void EatInputInRect(Rect eatRect)
17 if (eatRect.Contains(
new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)))
18 Input.ResetInputAxes();
21 public static GUISkin CustomSkin
25 if (_customSkin ==
null)
29 _customSkin = CreateSkin();
34 _customSkin = GUI.skin;
42 private static GUISkin CreateSkin()
44 var newSkin =
Object.Instantiate(GUI.skin);
45 Object.DontDestroyOnLoad(newSkin);
48 var texData = ResourceUtils.GetEmbeddedResource(
"guisharp-box.png");
49 _boxBackground = UnityFeatureHelper.LoadTexture(texData);
50 Object.DontDestroyOnLoad(_boxBackground);
51 newSkin.box.onNormal.background =
null;
52 newSkin.box.normal.background = _boxBackground;
53 newSkin.box.normal.textColor =
Color.white;
55 texData = ResourceUtils.GetEmbeddedResource(
"guisharp-window.png");
56 _winBackground = UnityFeatureHelper.LoadTexture(texData);
57 Object.DontDestroyOnLoad(_winBackground);
58 newSkin.window.onNormal.background =
null;
59 newSkin.window.normal.background = _winBackground;
60 newSkin.window.padding =
new RectOffset(6, 6, 22, 6);
61 newSkin.window.border =
new RectOffset(10, 10, 20, 10);
62 newSkin.window.normal.textColor =
Color.white;
64 newSkin.button.padding =
new RectOffset(4, 4, 3, 3);
65 newSkin.button.normal.textColor =
Color.white;
67 newSkin.textField.normal.textColor =
Color.white;
69 newSkin.label.normal.textColor =
Color.white;
void Log(LogLevel logLogLevel, object content)