24 lines
424 B
C#
24 lines
424 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class WarningAnimation : MonoBehaviour
|
|
{
|
|
private Text warningText; // ©Î TMP_Text
|
|
|
|
void OnEnable()
|
|
{
|
|
// °{Ã{®ÄªG
|
|
InvokeRepeating("Blink", 0f, 0.5f);
|
|
}
|
|
|
|
void OnDisable()
|
|
{
|
|
CancelInvoke("Blink");
|
|
}
|
|
|
|
void Blink()
|
|
{
|
|
warningText = GetComponent<Text>();
|
|
warningText.enabled = !warningText.enabled;
|
|
}
|
|
} |