Exemple #1
0
 private void CambioEstado(estadoPlayer estado)
 {
     if (this.estado != estadoPlayer.nadando && this.estado != estadoPlayer.inmune && estado != estadoPlayer.nadando && estado != estadoPlayer.inmune && estado != estadoPlayer.sinEstado)
     {
         this.estado = estado;
     }
 }
Exemple #2
0
    private void CambiarDireccion()
    {
        estadoPlayer estadoNuevo = estadoPlayer.sinEstado;

        if (zPos > 0.01f)
        {
            this.transform.localScale = new Vector3(1, 1, 1);
            if (this.estado != estadoPlayer.volando && EstaEnSuelo())
            {
                estadoNuevo = (corriendo) ? estadoPlayer.corriendoDer : estadoPlayer.andandoDer;
            }
        }
        if (zPos < -0.01f)
        {
            this.transform.localScale = new Vector3(1, 1, -1);
            if (this.estado != estadoPlayer.volando && EstaEnSuelo())
            {
                estadoNuevo = (corriendo) ? estadoPlayer.corriendoIzq : estadoPlayer.andandoIzq;
            }
        }
        if (zPos < 0.01f && zPos > -0.01f)
        {
            if (this.estado != estadoPlayer.volando && EstaEnSuelo())
            {
                estadoNuevo = estadoPlayer.parado;
            }
        }
        CambioEstado(estadoNuevo);
    }
Exemple #3
0
 public void CambioEstadoEnAgua(estadoPlayer estado)
 {
     if (estado == estadoPlayer.nadando)
     {
         this.estado  = estado;
         velocidad   /= 2;
         fuerzaSalto /= 2;
     }
     if (this.estado == estadoPlayer.nadando)
     {
         if (estado == estadoPlayer.volando)
         {
             velocidad   *= 2;
             fuerzaSalto *= 2;
             this.estado  = estado;
             Invoke("ActivarTrigger", tiempoActivarTrigger);
         }
     }
 }
Exemple #4
0
 private void Start()
 {
     estado         = estadoPlayer.parado;
     rb             = this.GetComponent <Rigidbody>();
     playerAnimator = this.GetComponent <Animator>();
 }
Exemple #5
0
 private void QuitarInmunidad()
 {
     this.estado = estadoPlayer.parado;
 }
Exemple #6
0
 private void Inmunizar(float tiempo)
 {
     this.estado = estadoPlayer.inmune;
     Invoke("QuitarInmunidad", tiempo);
 }