-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInGameUI.cs
58 lines (51 loc) · 1.43 KB
/
InGameUI.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BTD_Mod_Helper.Api.Components;
using BTD_Mod_Helper.Api.Enums;
using BTD_Mod_Helper.Api;
using UnityEngine;
using BTD_Mod_Helper.Extensions;
using BTD_Mod_Helper.UI.Menus;
using BloonsTDClass;
using Random = System.Random;
using ClassesMenuUI;
using Il2CppAssets.Scripts.Unity.UI_New;
public static class InGamePanel
{
private static ModHelperPanel panel;
public static ModHelperImage image;
private static void CreatePanel(GameObject screen)
{
panel = screen.AddModHelperPanel(new Info("InGamePanel")
{
Anchor = new Vector2(1, 0),
Pivot = new Vector2(1, 0)
});
}
private static void Init()
{
var screen = CommonForegroundScreen.instance.transform;
var ModSavePanel = screen.FindChild("InGamePanel");
if (ModSavePanel == null)
CreatePanel(screen.gameObject);
}
private static void HideButton()
{
panel.SetActive(false);
}
public static void Show()
{
Init();
panel.SetActive(true);
}
public static void Hide()
{
var screen = CommonForegroundScreen.instance.transform;
var ModSavePanel = screen.FindChild("InGamePanel");
if (ModSavePanel != null)
HideButton();
}
}