23 lines
353 B
C#
23 lines
353 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class CloseMessItem : MonoBehaviour
|
|
{
|
|
public Text messageText;
|
|
|
|
private float timeToDestroy = 4f;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
timeToDestroy = Mathf.MoveTowards(timeToDestroy, 0f, Time.deltaTime);
|
|
if (timeToDestroy == 0f)
|
|
{
|
|
Object.Destroy(base.gameObject);
|
|
}
|
|
}
|
|
}
|