2024-02-19 21:00:36 +03:00

21 lines
388 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;
public class RemoveByTime : NetworkBehaviour
{
public float removeTime = 2f;
void Start()
{
StartCoroutine(SelfRemove());
}
IEnumerator SelfRemove()
{
yield return new WaitForSeconds(removeTime);
NetworkServer.Destroy(this.gameObject);
}
}