/// <summary> /// ici est appelé quand on vient d'atterrire après un saut ! /// </summary> private void IsJustGrounded() { if (hasJumpAndFlying && worldCollision.CoolDownGroundedJump.IsReady() && worldCollision.IsGroundedSafe()) //on a sauté ! ducoup on est ok pour se poser { SoundManager.Instance.PlaySound("Play_pas"); hasJumpAndFlying = false; playerControlledAirJump.ControlledAirJumpSetup(false, Vector3.zero); //PlayerConnected.Instance.setVibrationPlayer(playerController.IdPlayer, onGrounded); playerController.PlayersManager.Jump(playerController.IdPlayer); playerController.PlayersManager.ResetOtherWhenGrounded(playerController.IdPlayer); externalForce.ResetInitialParameter(); playerGrip.TryToAutoGrip(); playerAirJump.ResetAirJump(); //reset les air jump } }
/// <summary> /// déplace le player /// </summary> private void TryToMove() { //ici gérer le air control if (!CanMove()) { if (isOnAirMove) { Debug.Log("air move fin"); //pointPivot = Vector3.zero; coolDownInactiveAirMove.StartCoolDown(); DebugExtension.DebugWireSphere(transform.position, Color.red, 1f, 1f); } isOnAirMove = false; return; } if (!isOnAirMove) { /*//ici test supplémentaire au airMove * if (!coolDownInactiveAirMove.IsReady() && activeTimer) * { * Debug.LogWarning("ici on vient de finir un airMove... attendre avant de commencer le suivant..."); * return; * }*/ if (coolDownInactiveAirMove.IsReady()) { //ici on a arreté, et quand on reprend... le timer a dépassé 0.3sec... ducoup //forcément on reprend à zero... ResetForcePendule(); InverseReset(); } DebugExtension.DebugWireSphere(transform.position, Color.green, 1f, 1f); Debug.Log("air move debut"); isOnAirMove = true; externalForce.ResetInitialParameter(); } AirMove(); }