コード例 #1
0
    void Start()
    {
        moveSpeed = SuperMath.CalculateJumpSpeed(TossHeight, Gravity);

        spawnTime = Time.time;

        StartCoroutine(FlickerAndDie());

        Instantiate(AppearSound, transform.position, Quaternion.identity);
    }
コード例 #2
0
        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);
        }
コード例 #3
0
    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;
        }
    }
コード例 #4
0
 void Bounce(float height)
 {
     moveDirection += SuperMath.CalculateJumpSpeed(height, Gravity) * Vector3.up;
 }