LieutenantChampignon/Projet Unity/Lieutenant Champignon/Assets/Scripts/Killable.cs

17 lines
333 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Killable : MonoBehaviour
{
[SerializeField]
public bool isEnnemy = true;
public void die(){
if (isEnnemy) this.gameObject.SetActive(false);
else {
GameObject.Find("Mousy").GetComponent<PlayerLogic>().die();
}
}
}