24 lines
396 B
C#
24 lines
396 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Photon.Pun;
|
|
using UnityEngine;
|
|
|
|
public class DestroyAfterTime : MonoBehaviour
|
|
{
|
|
public float timer = 2f;
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if(timer > 0){
|
|
timer-=Time.deltaTime;
|
|
return;
|
|
}else{
|
|
PhotonNetwork.Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|