You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
929 B
40 lines
929 B
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using UnityEngine.UI;
|
||
|
public enum BtnState :int
|
||
|
{
|
||
|
Idle=0,
|
||
|
Hide=1,
|
||
|
Show=2
|
||
|
}
|
||
|
public class QuestionIntroManager : MonoBehaviour {
|
||
|
private Animator ani;
|
||
|
private Button AniBtn;
|
||
|
private Button HideBtn;
|
||
|
// Use this for initialization
|
||
|
void Start () {
|
||
|
ani = GetComponent<Animator>();
|
||
|
AniBtn = transform.Find("Button").GetComponent<Button>();
|
||
|
|
||
|
|
||
|
AniBtn.onClick.AddListener(Show);
|
||
|
|
||
|
}
|
||
|
bool Flag = true;
|
||
|
private void Show()
|
||
|
{
|
||
|
if (Flag)
|
||
|
{
|
||
|
ani.CrossFade("QIHide", 0);
|
||
|
AniBtn.GetComponent<RectTransform>().localEulerAngles = new Vector3(0, 0, 180f);
|
||
|
Flag = false;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
AniBtn.GetComponent<RectTransform>().localEulerAngles = new Vector3(0, 0, 0);
|
||
|
ani.CrossFade("QIShow", 0);
|
||
|
Flag = true;
|
||
|
}
|
||
|
}
|
||
|
}
|