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.
39 lines
1.2 KiB
39 lines
1.2 KiB
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class PrePareKaoGuan : MonoBehaviour {
|
||
|
|
||
|
private bool Flag = true;
|
||
|
private Animator Ani;
|
||
|
private Button StretchAndShrinkButton;
|
||
|
private Text NameText;
|
||
|
void Start () {
|
||
|
Ani = this.gameObject.GetComponent<Animator>();
|
||
|
StretchAndShrinkButton = transform.Find("StretchAndShrinkButton").GetComponent<Button>();
|
||
|
StretchAndShrinkButton.onClick.AddListener(ShowAndCloseImage);
|
||
|
NameText = transform.Find("NameText").GetComponent<Text>();
|
||
|
}
|
||
|
public void ShowAndCloseImage()
|
||
|
{
|
||
|
if (Flag)
|
||
|
{
|
||
|
Ani.CrossFade("Stretch", 0);
|
||
|
StretchAndShrinkButton.GetComponent<RectTransform>().localEulerAngles = new Vector3(0, 0, 180f);
|
||
|
NameText.text = MySelf.mySelf.Name;
|
||
|
Flag = false;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
StretchAndShrinkButton.GetComponent<RectTransform>().localEulerAngles = new Vector3(0, 0, 0);
|
||
|
Ani.CrossFade("Shrink", 0);
|
||
|
NameText.text = MySelf.mySelf.Name;
|
||
|
Flag = true;
|
||
|
}
|
||
|
}
|
||
|
// Update is called once per frame
|
||
|
void Update () {
|
||
|
|
||
|
}
|
||
|
}
|