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.
31 lines
714 B
31 lines
714 B
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.UI; |
|
|
|
public class UITiShiManager : MonoBehaviour { |
|
float alp; |
|
private CanvasGroup canvas; |
|
private float alpa = 0.1f; |
|
private bool why = false; |
|
void Update() |
|
{ |
|
if (why) |
|
{ |
|
alp = canvas.alpha; |
|
alp -= Time.deltaTime * alpa; |
|
canvas.alpha = alp; |
|
if (canvas.alpha <= 0) |
|
{ |
|
gameObject.SetActive(false); |
|
why = false; |
|
} |
|
} |
|
} |
|
public void Get(string tip) |
|
{ |
|
canvas = GetComponent<CanvasGroup>(); |
|
canvas.alpha = 1; |
|
GetComponent<Text>().text = tip; |
|
why = true; |
|
} |
|
}
|
|
|