MiniGames/Assets/Scripts/CubeClash/CubeClash_Water.cs

21 lines
497 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeClash_Water : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if(other.GetComponent<CubeClash_ZibuController>() != null)
{
StartCoroutine(Destroyer(other.gameObject));
}
}
IEnumerator Destroyer(GameObject obj)
{
yield return new WaitForSeconds(1);
Debug.Log("Destroying: "+obj.name);
Destroy(obj);
}
}