Example #1
0
 //verificador de salud del objetivo, para cambiar de objetivo cuando éste este muerto
 private void VerificarSaludEnemigo()
 {
     if (ciudadanoControlador && ciudadanoControlador.CantidadSalud <= 0)
     {
         atacando             = false;
         ciudadanoControlador = null;
     }
 }
Example #2
0
 //Referencias iniciales
 void Awake()
 {
     controladorPlayer    = this;
     ReferenciaCamara     = GetComponentInChildren <Camera>();
     transformCamara      = ReferenciaCamara.transform;
     transformPlayer      = transform;
     lineRendererPlayer   = GetComponent <LineRenderer>();
     ciudadanoControlador = GetComponent <CiudadanoControlador>();
 }
Example #3
0
 //Lanza dos LineRenderer al objetivo y si son golpeados rebajan su vida
 private void AtaqueZombie(Transform mano, LineRenderer lineaMano, ref Transform contenedor)
 {
     StartCoroutine(TiempoAtaque(lineaMano));
     lineaMano.SetPosition(0, mano.position);
     tiempoAcumuladoAtaque = Time.time;
     if (BuscarRaycast(mano.position, mano.forward, ref contenedor, rangoDeAtaque, capasNPC))
     {
         lineaMano.SetPosition(1, contenedor.position);
         if (!ciudadanoControlador)
         {
             ciudadanoControlador = contenedor.GetComponent <CiudadanoControlador>();
         }
         ciudadanoControlador.CantidadSalud -= 5;
     }
     else
     {
         lineaMano.SetPosition(1, mano.position + mano.forward * rangoDeAtaque);
     }
 }