21 lines
388 B
C#
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);
|
|
}
|
|
}
|