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.
37 lines
882 B
37 lines
882 B
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using UnityEngine.UI;
|
||
|
public class ControlBroweMenuAni : MonoBehaviour {
|
||
|
|
||
|
/// <summary>
|
||
|
/// 用于工具栏的显示隐藏
|
||
|
/// </summary>
|
||
|
private bool Flag = true;
|
||
|
private Animator Ani;
|
||
|
void Start ()
|
||
|
{
|
||
|
this.GetComponent<Button>().onClick.AddListener(BroweMenuAni);
|
||
|
Ani = this.gameObject.transform.parent.GetComponent<Animator>();
|
||
|
}
|
||
|
|
||
|
public void BroweMenuAni()
|
||
|
{
|
||
|
|
||
|
if (Flag)
|
||
|
{
|
||
|
|
||
|
Flag = false;
|
||
|
Ani.CrossFade("BroweMenu", 0);
|
||
|
this.GetComponent<RectTransform>().localEulerAngles = new Vector3(0, 0, 180f);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Flag = true;
|
||
|
Ani.CrossFade("BroweMenuShow", 0);
|
||
|
this.GetComponent<RectTransform>().localEulerAngles = new Vector3(0, 0, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|