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; } }
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); }
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); } } }
private void Start() { estado = estadoPlayer.parado; rb = this.GetComponent <Rigidbody>(); playerAnimator = this.GetComponent <Animator>(); }
private void QuitarInmunidad() { this.estado = estadoPlayer.parado; }
private void Inmunizar(float tiempo) { this.estado = estadoPlayer.inmune; Invoke("QuitarInmunidad", tiempo); }