void Start() { moveSpeed = SuperMath.CalculateJumpSpeed(TossHeight, Gravity); spawnTime = Time.time; StartCoroutine(FlickerAndDie()); Instantiate(AppearSound, transform.position, Quaternion.identity); }
public override void EnterState() { playerView.Animator.SetBool("IsJumping", true); playerView.Animator.SetBool("IsLanding", false); playerView.CanJump = false; playerController.IsClamping = false; playerController.IsSlopeLimiting = false; stateMachine.MoveDirection += playerView.Up * SuperMath.CalculateJumpSpeed(player.CurrentJumpHeight, player.CurrentGravity); }
void Spring_Update() { Shadow.Scale = Art.localScale.x; if (SuperMath.Timer(timeEnteredState, Art.GetComponent <Animation>()["spring"].length)) { moveDirection = (Target.position - transform.position).normalized * BounceSpeed; moveDirection += SuperMath.CalculateJumpSpeed(BounceHeight, Gravity) * Vector3.up; currentState = WaterBombStates.Bounce; return; } }
void Bounce(float height) { moveDirection += SuperMath.CalculateJumpSpeed(height, Gravity) * Vector3.up; }