Files
Dec2017-Script-Dump/GUIAnimatorFREE/GUIAnimSystemFREE.cs
T
2026-06-04 11:42:34 +02:00

707 lines
18 KiB
C#

using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000003 RID: 3
public class GUIAnimSystemFREE : MonoBehaviour
{
// Token: 0x17000001 RID: 1
// (get) Token: 0x06000042 RID: 66 RVA: 0x000063AC File Offset: 0x000045AC
// (set) Token: 0x06000043 RID: 67 RVA: 0x000063E6 File Offset: 0x000045E6
public static GUIAnimSystemFREE Instance
{
get
{
if (GUIAnimSystemFREE.instance == null)
{
GUIAnimSystemFREE.instance = global::UnityEngine.Object.FindObjectOfType<GUIAnimSystemFREE>();
if (GUIAnimSystemFREE.instance != null)
{
global::UnityEngine.Object.DontDestroyOnLoad(GUIAnimSystemFREE.instance.gameObject);
}
}
return GUIAnimSystemFREE.instance;
}
set
{
GUIAnimSystemFREE.instance = GUIAnimSystemFREE.Instance;
if (GUIAnimSystemFREE.instance != null)
{
global::UnityEngine.Object.DontDestroyOnLoad(GUIAnimSystemFREE.instance.gameObject);
}
}
}
// Token: 0x06000044 RID: 68 RVA: 0x0000640E File Offset: 0x0000460E
public GUIAnimSystemFREE GetInstance()
{
return GUIAnimSystemFREE.instance;
}
// Token: 0x06000045 RID: 69 RVA: 0x00006415 File Offset: 0x00004615
private void Awake()
{
if (GUIAnimSystemFREE.instance == null)
{
GUIAnimSystemFREE.instance = this;
global::UnityEngine.Object.DontDestroyOnLoad(this);
return;
}
if (this != GUIAnimSystemFREE.instance)
{
global::UnityEngine.Object.Destroy(base.gameObject);
}
}
// Token: 0x06000046 RID: 70 RVA: 0x0000230F File Offset: 0x0000050F
private void Start()
{
}
// Token: 0x06000047 RID: 71 RVA: 0x00006449 File Offset: 0x00004649
private void Update()
{
if (this.m_SetShowFreeVersion && this.m_ShowFreeVersionText > 0f)
{
this.m_ShowFreeVersionText -= Time.deltaTime;
}
}
// Token: 0x06000048 RID: 72 RVA: 0x00006472 File Offset: 0x00004672
private void OnGUI()
{
if (this.m_SetShowFreeVersion && this.m_ShowFreeVersionText > 0f)
{
this.ShowFreeVersionText();
}
}
// Token: 0x06000049 RID: 73 RVA: 0x00006490 File Offset: 0x00004690
private void ShowFreeVersionText()
{
if (this.m_SetShowFreeVersion)
{
string text = "GUI Animator FREE (" + string.Format("{0:0}", this.m_ShowFreeVersionText) + ")";
if (GUI.Button(new Rect(10f, 10f, 150f, 25f), text))
{
Application.OpenURL("https://www.assetstore.unity3d.com/#!/content/28709");
}
}
}
// Token: 0x0600004A RID: 74 RVA: 0x000064F8 File Offset: 0x000046F8
public void LoadLevel(string LevelName, float delay)
{
if (delay <= 0f)
{
Application.LoadLevel(LevelName);
return;
}
if (base.gameObject.activeInHierarchy)
{
base.StartCoroutine(this.LoadLevelDelay(LevelName, delay));
return;
}
Debug.LogWarning(base.name + " is inactive");
}
// Token: 0x0600004B RID: 75 RVA: 0x00006546 File Offset: 0x00004746
private IEnumerator LoadLevelDelay(string LevelName, float delay)
{
yield return new WaitForSeconds(delay);
Application.LoadLevel(LevelName);
yield break;
}
// Token: 0x0600004C RID: 76 RVA: 0x0000655C File Offset: 0x0000475C
public void MoveIn(Transform trans, bool EffectsOnChildren)
{
if (!trans.gameObject.activeSelf)
{
return;
}
GUIAnimFREE component = trans.gameObject.GetComponent<GUIAnimFREE>();
if (component != null && component.enabled)
{
component.MoveIn();
}
Button component2 = trans.gameObject.GetComponent<Button>();
if (component2 != null)
{
component2.interactable = true;
}
if (EffectsOnChildren)
{
foreach (object obj in trans)
{
Transform transform = (Transform)obj;
this.MoveIn(transform, EffectsOnChildren);
}
}
}
// Token: 0x0600004D RID: 77 RVA: 0x00006604 File Offset: 0x00004804
public void MoveInAll()
{
if (!base.gameObject.activeSelf)
{
return;
}
GUIAnimFREE[] array = global::UnityEngine.Object.FindObjectsOfType<GUIAnimFREE>();
for (int i = 0; i < array.Length; i++)
{
array[i].MoveIn(GUIAnimSystemFREE.eGUIMove.Self);
}
}
// Token: 0x0600004E RID: 78 RVA: 0x0000663C File Offset: 0x0000483C
public void MoveOut(Transform trans, bool EffectsOnChildren)
{
if (!trans.gameObject.activeSelf)
{
return;
}
GUIAnimFREE component = trans.gameObject.GetComponent<GUIAnimFREE>();
if (component != null && component.enabled)
{
component.MoveOut();
}
Button component2 = trans.gameObject.GetComponent<Button>();
if (component2 != null)
{
component2.interactable = false;
}
if (EffectsOnChildren)
{
foreach (object obj in trans)
{
Transform transform = (Transform)obj;
this.MoveOut(transform, EffectsOnChildren);
}
}
}
// Token: 0x0600004F RID: 79 RVA: 0x000066E4 File Offset: 0x000048E4
public void MoveOutAll()
{
if (!base.gameObject.activeSelf)
{
return;
}
GUIAnimFREE[] array = global::UnityEngine.Object.FindObjectsOfType<GUIAnimFREE>();
for (int i = 0; i < array.Length; i++)
{
array[i].MoveOut(GUIAnimSystemFREE.eGUIMove.Self);
}
}
// Token: 0x06000050 RID: 80 RVA: 0x0000671C File Offset: 0x0000491C
public void PlayParticle(Transform trans)
{
AudioSource component = trans.gameObject.GetComponent<AudioSource>();
if (component != null)
{
component.Play();
}
foreach (object obj in trans)
{
Transform transform = (Transform)obj;
ParticleSystem component2 = transform.gameObject.GetComponent<ParticleSystem>();
if (component2 != null)
{
component2.enableEmission = true;
component2.Play(true);
}
else
{
this.PlayParticle(transform.transform);
}
AudioSource component3 = transform.gameObject.GetComponent<AudioSource>();
if (component3 != null)
{
component3.Play();
}
}
}
// Token: 0x06000051 RID: 81 RVA: 0x000067D8 File Offset: 0x000049D8
public void StopParticle(Transform trans)
{
foreach (object obj in trans)
{
Transform transform = (Transform)obj;
ParticleSystem component = transform.gameObject.GetComponent<ParticleSystem>();
if (component != null)
{
component.enableEmission = false;
component.Stop(true);
}
else
{
this.StopParticle(transform.transform);
}
}
}
// Token: 0x06000052 RID: 82 RVA: 0x00006858 File Offset: 0x00004A58
public void DontDestroyParticleWhenLoadNewScene(Transform trans, bool StopParticle)
{
if (base.gameObject.activeInHierarchy)
{
base.StartCoroutine(this.DontDestroyParticleWhenLoadNewSceneDelay(trans, StopParticle, 0.1f));
return;
}
Debug.LogWarning(base.name + " is inactive");
}
// Token: 0x06000053 RID: 83 RVA: 0x00006891 File Offset: 0x00004A91
private IEnumerator DontDestroyParticleWhenLoadNewSceneDelay(Transform trans, bool StopParticle, float delay)
{
yield return new WaitForSeconds(delay);
using (IEnumerator enumerator = trans.GetEnumerator())
{
while (enumerator.MoveNext())
{
object obj = enumerator.Current;
Transform transform = (Transform)obj;
ParticleSystem component = transform.gameObject.GetComponent<ParticleSystem>();
if (component != null)
{
if (component.IsAlive())
{
if (StopParticle)
{
component.loop = false;
component.enableEmission = false;
if (component.isPlaying)
{
component.Stop();
}
}
component.transform.SetParent(this.transform);
global::UnityEngine.Object.Destroy(component.gameObject, 10f);
}
}
else
{
this.DontDestroyParticleWhenLoadNewScene(transform.transform, StopParticle);
}
}
yield break;
}
yield break;
}
// Token: 0x06000054 RID: 84 RVA: 0x000068B5 File Offset: 0x00004AB5
public void DontDestroyParticleWhenLoadNewScene(ParticleSystem pParticleSystem, bool StopParticle)
{
if (base.gameObject.activeInHierarchy)
{
base.StartCoroutine(this.DontDestroyParticleWhenLoadNewSceneDelay(pParticleSystem, StopParticle, 0.1f));
return;
}
Debug.LogWarning(base.name + " is inactive");
}
// Token: 0x06000055 RID: 85 RVA: 0x000068EE File Offset: 0x00004AEE
private IEnumerator DontDestroyParticleWhenLoadNewSceneDelay(ParticleSystem pParticleSystem, bool StopParticle, float delay)
{
yield return new WaitForSeconds(delay);
if (pParticleSystem != null && pParticleSystem.IsAlive())
{
if (StopParticle)
{
pParticleSystem.loop = false;
pParticleSystem.enableEmission = false;
if (pParticleSystem.isPlaying)
{
pParticleSystem.Stop();
}
}
pParticleSystem.transform.SetParent(this.transform);
global::UnityEngine.Object.Destroy(pParticleSystem.gameObject, 10f);
}
yield break;
}
// Token: 0x06000056 RID: 86 RVA: 0x00006914 File Offset: 0x00004B14
public void FocusOnlyThisCanvas(GameObject gOB)
{
foreach (Canvas canvas in global::UnityEngine.Object.FindObjectsOfType<Canvas>())
{
GraphicRaycaster component = canvas.gameObject.GetComponent<GraphicRaycaster>();
if (component != null)
{
if (canvas.gameObject == gOB)
{
component.enabled = true;
}
else
{
component.enabled = false;
}
}
}
}
// Token: 0x06000057 RID: 87 RVA: 0x0000696C File Offset: 0x00004B6C
public void FocusTheseCanvases(GameObject[] gOBs)
{
Canvas[] array = global::UnityEngine.Object.FindObjectsOfType<Canvas>();
for (int i = 0; i < array.Length; i++)
{
GraphicRaycaster component = array[i].gameObject.GetComponent<GraphicRaycaster>();
if (component != null)
{
component.enabled = false;
}
}
for (int i = 0; i < gOBs.Length; i++)
{
GraphicRaycaster component2 = gOBs[i].GetComponent<GraphicRaycaster>();
if (component2 != null)
{
component2.enabled = true;
}
}
}
// Token: 0x06000058 RID: 88 RVA: 0x000069D8 File Offset: 0x00004BD8
public void FocusThisCanvas(Canvas pCanvas)
{
foreach (Canvas canvas in global::UnityEngine.Object.FindObjectsOfType<Canvas>())
{
if (canvas.gameObject.GetComponent<GraphicRaycaster>() != null)
{
if (canvas.gameObject == pCanvas)
{
canvas.enabled = true;
}
else
{
canvas.enabled = false;
}
}
}
}
// Token: 0x06000059 RID: 89 RVA: 0x00006A30 File Offset: 0x00004C30
public void FocusTheseCanvas(Canvas[] pCanvases)
{
foreach (Canvas canvas in global::UnityEngine.Object.FindObjectsOfType<Canvas>())
{
if (canvas.gameObject.GetComponent<GraphicRaycaster>() != null)
{
canvas.enabled = false;
}
}
foreach (Canvas canvas2 in pCanvases)
{
if (canvas2.gameObject.GetComponent<GraphicRaycaster>() != null)
{
canvas2.enabled = true;
}
}
}
// Token: 0x0600005A RID: 90 RVA: 0x00006AA0 File Offset: 0x00004CA0
public void FocusThisCanvas(GraphicRaycaster pGraphicRaycaster)
{
foreach (GraphicRaycaster graphicRaycaster in global::UnityEngine.Object.FindObjectsOfType<GraphicRaycaster>())
{
if (graphicRaycaster == pGraphicRaycaster)
{
graphicRaycaster.enabled = true;
}
else
{
graphicRaycaster.enabled = false;
}
}
}
// Token: 0x0600005B RID: 91 RVA: 0x00006AE0 File Offset: 0x00004CE0
public void FocusTheseCanvases(GraphicRaycaster[] pGraphicRaycasters)
{
GraphicRaycaster[] array = global::UnityEngine.Object.FindObjectsOfType<GraphicRaycaster>();
for (int i = 0; i < array.Length; i++)
{
array[i].enabled = false;
}
for (int i = 0; i < pGraphicRaycasters.Length; i++)
{
pGraphicRaycasters[i].enabled = true;
}
}
// Token: 0x0600005C RID: 92 RVA: 0x00006B24 File Offset: 0x00004D24
public void SetGraphicRaycasterEnable(GameObject gOB, bool Enable)
{
GraphicRaycaster component = gOB.GetComponent<GraphicRaycaster>();
if (component != null)
{
component.enabled = Enable;
}
}
// Token: 0x0600005D RID: 93 RVA: 0x00006B48 File Offset: 0x00004D48
public void SetGraphicRaycasterEnable(Canvas pCanvas, bool Enable)
{
GraphicRaycaster component = pCanvas.gameObject.GetComponent<GraphicRaycaster>();
if (component != null)
{
component.enabled = Enable;
}
}
// Token: 0x0600005E RID: 94 RVA: 0x00006B71 File Offset: 0x00004D71
public void SetGraphicRaycasterEnable(GraphicRaycaster pGraphicRaycaster, bool Enable)
{
if (pGraphicRaycaster != null)
{
pGraphicRaycaster.enabled = Enable;
}
}
// Token: 0x0600005F RID: 95 RVA: 0x00006B84 File Offset: 0x00004D84
public void EnableAllGraphicRaycasters(bool Enable)
{
Canvas[] array = global::UnityEngine.Object.FindObjectsOfType<Canvas>();
for (int i = 0; i < array.Length; i++)
{
GraphicRaycaster component = array[i].gameObject.GetComponent<GraphicRaycaster>();
if (component != null)
{
component.enabled = Enable;
}
}
}
// Token: 0x06000060 RID: 96 RVA: 0x00006BC4 File Offset: 0x00004DC4
public void EnableAllButtons(bool Enable)
{
Button[] array = global::UnityEngine.Object.FindObjectsOfType<Button>();
for (int i = 0; i < array.Length; i++)
{
array[i].enabled = Enable;
}
}
// Token: 0x06000061 RID: 97 RVA: 0x00006BEE File Offset: 0x00004DEE
public void EnableButton(bool Enable, float Seconds)
{
if (base.gameObject.activeInHierarchy)
{
base.StartCoroutine(this.DelayEnableButton(Enable, Seconds));
return;
}
Debug.LogWarning(base.name + " is inactive");
}
// Token: 0x06000062 RID: 98 RVA: 0x00006C22 File Offset: 0x00004E22
private IEnumerator DelayEnableButton(bool Enable, float Seconds)
{
yield return new WaitForSeconds(Seconds);
Button[] array = global::UnityEngine.Object.FindObjectsOfType<Button>();
for (int i = 0; i < array.Length; i++)
{
array[i].enabled = Enable;
}
yield break;
}
// Token: 0x06000063 RID: 99 RVA: 0x00006C38 File Offset: 0x00004E38
public void EnableButton(Transform trans, bool Enable)
{
Button component = trans.gameObject.GetComponent<Button>();
if (component != null)
{
component.enabled = Enable;
}
foreach (object obj in trans)
{
Transform transform = (Transform)obj;
this.EnableButton(transform, Enable);
}
}
// Token: 0x06000064 RID: 100 RVA: 0x00006CAC File Offset: 0x00004EAC
public void EnableButton(Transform trans, bool Enable, float Seconds)
{
if (base.gameObject.activeInHierarchy)
{
base.StartCoroutine(this.DelayEnableButton(trans, Enable, Seconds));
return;
}
Debug.LogWarning(base.name + " is inactive");
}
// Token: 0x06000065 RID: 101 RVA: 0x00006CE1 File Offset: 0x00004EE1
private IEnumerator DelayEnableButton(Transform trans, bool Enable, float Seconds)
{
yield return new WaitForSeconds(Seconds);
Button component = trans.gameObject.GetComponent<Button>();
if (component != null)
{
component.enabled = Enable;
}
using (IEnumerator enumerator = trans.GetEnumerator())
{
while (enumerator.MoveNext())
{
object obj = enumerator.Current;
Transform transform = (Transform)obj;
this.EnableButton(transform, Enable);
}
yield break;
}
yield break;
}
// Token: 0x06000066 RID: 102 RVA: 0x00006D08 File Offset: 0x00004F08
public void SetInteracableAllButtons(bool Interacable)
{
Button[] array = global::UnityEngine.Object.FindObjectsOfType<Button>();
for (int i = 0; i < array.Length; i++)
{
array[i].interactable = Interacable;
}
}
// Token: 0x06000067 RID: 103 RVA: 0x00006D32 File Offset: 0x00004F32
public void SetInteracableAllButtons(bool Interacable, float Seconds)
{
if (base.gameObject.activeInHierarchy)
{
base.StartCoroutine(this.DelayInteracableOfAllButton(Interacable, Seconds));
return;
}
Debug.LogWarning(base.name + " is inactive");
}
// Token: 0x06000068 RID: 104 RVA: 0x00006D66 File Offset: 0x00004F66
private IEnumerator DelayInteracableOfAllButton(bool Interacable, float Seconds)
{
yield return new WaitForSeconds(Seconds);
Button[] array = global::UnityEngine.Object.FindObjectsOfType<Button>();
for (int i = 0; i < array.Length; i++)
{
array[i].interactable = Interacable;
}
yield break;
}
// Token: 0x06000069 RID: 105 RVA: 0x00006D7C File Offset: 0x00004F7C
public void InteracableButton(Transform trans, bool Interacable)
{
Button component = trans.gameObject.GetComponent<Button>();
if (component != null)
{
component.interactable = Interacable;
}
foreach (object obj in trans)
{
Transform transform = (Transform)obj;
this.InteracableButton(transform, Interacable);
}
}
// Token: 0x0600006A RID: 106 RVA: 0x00006DF0 File Offset: 0x00004FF0
public void InteracableButton(Transform trans, bool Interacable, float Seconds)
{
if (base.gameObject.activeInHierarchy)
{
base.StartCoroutine(this.DelayInteracableButton(trans, Interacable, Seconds));
return;
}
Debug.LogWarning(base.name + " is inactive");
}
// Token: 0x0600006B RID: 107 RVA: 0x00006E25 File Offset: 0x00005025
private IEnumerator DelayInteracableButton(Transform trans, bool Interacable, float Seconds)
{
yield return new WaitForSeconds(Seconds);
Button component = trans.gameObject.GetComponent<Button>();
if (component != null)
{
component.interactable = Interacable;
}
using (IEnumerator enumerator = trans.GetEnumerator())
{
while (enumerator.MoveNext())
{
object obj = enumerator.Current;
Transform transform = (Transform)obj;
this.InteracableButton(transform, Interacable);
}
yield break;
}
yield break;
}
// Token: 0x0600006C RID: 108 RVA: 0x00006E4C File Offset: 0x0000504C
public Canvas GetParent_Canvas(Transform trans)
{
Transform transform = trans.parent;
while (transform != null)
{
Canvas component = transform.gameObject.GetComponent<Canvas>();
if (component != null)
{
return component;
}
transform = transform.parent;
}
return null;
}
// Token: 0x04000036 RID: 54
private static GUIAnimSystemFREE instance;
// Token: 0x04000037 RID: 55
[Range(0.5f, 10f)]
public float m_GUISpeed = 1f;
// Token: 0x04000038 RID: 56
public bool m_AutoAnimation = true;
// Token: 0x04000039 RID: 57
public GUIAnimSystemFREE.eAnimationMode m_AnimationMode = GUIAnimSystemFREE.eAnimationMode.All;
// Token: 0x0400003A RID: 58
public float m_IdleTime = 8f;
// Token: 0x0400003B RID: 59
private bool m_SetShowFreeVersion = true;
// Token: 0x0400003C RID: 60
private float m_ShowFreeVersionText = 8f;
// Token: 0x02000017 RID: 23
public enum eAnimationMode
{
// Token: 0x040000FC RID: 252
None,
// Token: 0x040000FD RID: 253
In,
// Token: 0x040000FE RID: 254
Idle,
// Token: 0x040000FF RID: 255
Out,
// Token: 0x04000100 RID: 256
All
}
// Token: 0x02000018 RID: 24
public enum eGUIMove
{
// Token: 0x04000102 RID: 258
Self,
// Token: 0x04000103 RID: 259
Children,
// Token: 0x04000104 RID: 260
SelfAndChildren
}
}