blob: 9213223f98e83d497683304e7059623a7f7b3224 (
plain)
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
|
using System;
using UnityEngine;
public class CustomPlayerMenu : MonoBehaviour
{
public static CustomPlayerMenu Instance;
public TabButton[] Tabs;
public Sprite NormalColor;
public Sprite SelectedColor;
public void Start()
{
CustomPlayerMenu.Instance = this;
}
public void OpenTab(GameObject tab)
{
for (int i = 0; i < this.Tabs.Length; i++)
{
TabButton tabButton = this.Tabs[i];
if (tabButton.Tab == tab)
{
tabButton.Tab.SetActive(true);
tabButton.Button.sprite = this.SelectedColor;
}
else
{
tabButton.Tab.SetActive(false);
tabButton.Button.sprite = this.NormalColor;
}
}
}
public void Close(bool canMove)
{
UnityEngine.Object.Destroy(base.gameObject);
}
}
|