You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PlumberUltimateAds/Assets/Scripts/MessagePopup.cs

74 lines
1.3 KiB
C#

2 months ago
/*
http://www.cgsoso.com/forum-211-1.html
CG Unity3d Unity3d VIP
CGSOSO CG
daily assets update for try.
U should buy the asset from home store if u use it in your project!
*/
using System;
using System.Collections;
using UnityEngine;
public class MessagePopup : MonoBehaviour
{
public static MessagePopup instance;
private void Awake()
{
instance = this;
}
public void ShowMessage(int index)
{
int num = 0;
IEnumerator enumerator = base.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform transform = (Transform)enumerator.Current;
transform.gameObject.SetActive(num == index);
num++;
}
}
finally
{
IDisposable disposable;
if ((disposable = (enumerator as IDisposable)) != null)
{
disposable.Dispose();
}
}
}
public void HideAll()
{
int num = 0;
IEnumerator enumerator = base.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform transform = (Transform)enumerator.Current;
transform.gameObject.SetActive(value: false);
num++;
}
}
finally
{
IDisposable disposable;
if ((disposable = (enumerator as IDisposable)) != null)
{
disposable.Dispose();
}
}
}
}