snakes_mp/Assets/Scripts/Utils/DestroyAfterTime.cs
2025-04-14 11:36:17 +05:30

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);
}
}
}