using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DatoEnemigodatoesdatandoeldatodatado : MonoBehaviour {
public int damage;
public int vidaEnemigo;
public Slider BarraVidaEnemigo;
void Update () {
BarraVidaEnemigo.value = vidaEnemigo;
if(Input.GetKeyDown(KeyCode.E))/////////ORIGINAL
{
vidaEnemigo-=damage;
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ARRASA : MonoBehaviour {
public int damage;
public int vidaEnemigo;
public Slider BarraVidaEnemigo;
void Update () {
BarraVidaEnemigo.value = vidaEnemigo;
}
void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag ("Player")){
vidaEnemigo-=damage;
if (vidaEnemigo <= 0) {
Destroy (this.gameObject);
}
}}
}
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class OTAMAS : MonoBehaviour {
public int damage;
public int vidaEnemigo;
public Slider BarraVidaEnemigo;
void Update () {
BarraVidaEnemigo.value = vidaEnemigo;
}
void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag ("MATA")){
vidaEnemigo-=damage;
if (vidaEnemigo <= 0) {
Destroy (this.gameObject);
}
}}
}
No hay comentarios:
Publicar un comentario