| 123456789101112131415161718192021222324 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using TMPro;
- public class DestroyMiss : MonoBehaviour
- {
- public float stayTime;
- [HideInInspector]
- public float time;
- public TextMeshProUGUI text;
- private void Update()
- {
- time += Time.deltaTime;
- transform.position += Vector3.up * Time.deltaTime;
- Color color = text.color;
- color.a = 1 - time / 2;
- text.color = color;
- if (time >= stayTime)
- {
- gameObject.SetActive(false);
- }
- }
- }
|