예제 #1
0
    private void SpaceDown()
    {
        Debug.Log(CurrentState);

        if (HasBall && CurrentState == PlayerState.Idel)
        {
            CurrentState = PlayerState.Aiming;

/* AIM Jump
 *          _Rigidbody.velocity = Vector3.zero;
 *          _Rigidbody.useGravity = false;
 *          _Rigidbody.constraints = RigidbodyConstraints.FreezeAll;
 */

            _BallRotation            = 0f;
            _Ball.transform.position = _BallAnchor.transform.position;
            _Ball.PickUp();

            if (_SlowRoutine != null)
            {
                StopCoroutine(_SlowRoutine);
                _SlowRoutine = null;
            }

            _SlowRoutine = SlowTime(.6f, 1f);
            StartCoroutine(_SlowRoutine);
        }
        else if (CurrentState == PlayerState.Idel)
        {
            CurrentState = PlayerState.Jumping;
            _Animator.SetBool("Jump", true);

            if (_AimJump != null)
            {
                StopCoroutine(_AimJump);
                _AimJump = null;
            }

            _AimJump = AimJump();
            StartCoroutine(_AimJump);
        }
    }
예제 #2
0
    private IEnumerator TutorialRoutine()
    {
        _Start.gameObject.SetActive(false);

        _Player.SetSpeach("<fade>ok ok... NO need to <wiggle>YELL!</wiggle></fade>");
        yield return(new WaitForSeconds(3f));

        _Ball.SetSpeach("<fade>Let's get to the moon already...</fade>");
        yield return(new WaitForSeconds(3f));

        //_Player.SetSpeach("<fade><wiggle>BALL...</wiggle>We keep failing why the moon again...</fade>");

        _Animator.SetBool("Active", true);
        _Player.IsActive = true;

        _Tutorial.ShowText("use A and D to move");
        bool canMove = false;

        while (!canMove)
        {
            if (Input.GetAxis("Horizontal") > 0 || Input.GetAxis("Horizontal") < 0)
            {
                canMove = true;
            }
            yield return(null);
        }

        //_Ball.SetSpeach("<fade>If you get me to the moon ill grant you one wish!</fade>");

        _Tutorial.ShowText("hold SPACEBAR to start a jump");
        bool canJump = false;

        while (!canJump)
        {
            if (Input.GetKey(KeyCode.Space))
            {
                canJump = true;
            }

            yield return(null);
        }

        yield return(new WaitForSeconds(3f));

        _Ball.Rigidbody.useGravity = true;

        _Tutorial.ShowText("hold SPACEBAR while near BALL to start a throw");

        bool canTrhow = false;

        while (!canTrhow)
        {
            if (Input.GetKey(KeyCode.Space))
            {
                canTrhow = true;
            }

            yield return(null);
        }

        _Tutorial.ShowText("use A and D to aim your shot");
        yield return(new WaitForSeconds(7f));

        _Tutorial.ShowText("the moon is 699 mi away...");
        _Ball._Distance.gameObject.SetActive(true);
        yield return(new WaitForSeconds(7f));

        _Tutorial.ShowText("<fade> in times like this i find its best to say ~\\*.*/~ GOOD LUCK!</fade>");
    }