-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtageUguiGallery.cs
63 lines (56 loc) · 1.29 KB
/
UtageUguiGallery.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
59
60
61
62
using System;
using UnityEngine;
using Utage;
[AddComponentMenu("Utage/TemplateUI/Gallery")]
public class UtageUguiGallery : UguiView
{
[SerializeField]
private AdvEngine engine;
private int tabIndex = -1;
public UguiView[] views;
private void OnOpen()
{
this.Engine.SoundManager.StopAll(0.2f);
if (this.tabIndex >= 0)
{
this.views[this.tabIndex].ToggleOpen(true);
}
}
public void OnTabIndexChanged(int index)
{
if (index >= this.views.Length)
{
Debug.LogError("index < views.Length");
}
else
{
for (int i = 0; i < this.views.Length; i++)
{
if (i != index)
{
this.views[i].ToggleOpen(false);
}
}
this.views[index].ToggleOpen(true);
this.tabIndex = index;
}
}
public void Sleep()
{
base.get_gameObject().SetActive(false);
}
public void WakeUp()
{
base.get_gameObject().SetActive(true);
}
public AdvEngine Engine
{
get
{
if (this.engine == null)
{
}
return (this.engine = Object.FindObjectOfType<AdvEngine>());
}
}
}