Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetUnityChan.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class WidgetUnityChan : Widget
4{
5 public static WidgetUnityChan Instance;
6
7 public float angleFix;
8
9 public bool up;
10
11 public GameObject goWorld;
12
13 public GameObject prefabWorld;
14
15 public Animator animator;
16
17 public Camera cam;
18
19 public Vector3 scroll;
20
21 public override void OnActivate()
22 {
23 Instance = this;
24 goWorld = Object.Instantiate(prefabWorld);
25 animator = goWorld.GetComponentInChildren<Animator>();
26 cam = goWorld.GetComponentInChildren<Camera>();
27 }
28
29 public void OnDestroy()
30 {
31 Object.DestroyImmediate(goWorld);
32 }
33
34 public void Refresh(float angle)
35 {
36 animator.transform.localEulerAngles = new Vector3(0f, angle + angleFix, 0f);
37 cam.fieldOfView = (up ? 6f : 12f);
38 }
39
40 public override void OnSetContextMenu(UIContextMenu m)
41 {
42 m.AddChild("setting").AddToggle("Up", up, delegate(bool a)
43 {
44 up = a;
45 });
47 }
48}
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
void Refresh(float angle)
override void OnActivate()
GameObject prefabWorld
GameObject goWorld
static WidgetUnityChan Instance
override void OnSetContextMenu(UIContextMenu m)
Definition: Widget.cs:7
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608