コード例 #1
0
        void PogoBounce()
        {
            localVel.y = basePogoVel * Mathf.Pow(pogoVelMult, bounceCount + 1);
            localVel.z = finalJoystickVel * movSpeed;
            bounced    = true;
            switch (bounceState)
            {
            case PogoBounceState.Neutral:
                sounds.RegularBounce();
                break;

            case PogoBounceState.Good:
                sounds.GoodBounce();
                break;

            case PogoBounceState.Bad:
                sounds.BadBounce();
                break;

            case PogoBounceState.Mega:
                sounds.GodBounce();
                StartCoroutine(SparkleAfterDelay(.5f));
                break;
            }
            bounceState = PogoBounceState.Neutral;
        }
コード例 #2
0
        void OnTouchReleased(float timeHeld)
        {
            if (!pogoMode)
            {
                return;
            }

            bool goodRelease = (groundEnd - pogoInputWindow) <= pogoTime && pogoTime <= (groundEnd + pogoInputWindow);

            if (goodRelease)
            {
                Debug.Log("Good bounce!");
                bounceState = PogoBounceState.Good;

                if (bounceCount == godBounce || testGodBounce)
                {
                    basePogoVel *= testGodBounce ? 100f : 10f;
                    bounceState  = PogoBounceState.Mega;
                    StartCoroutine(PlayGodSequence(godSequenceStartDelay));
                }

                if (waitingOnBounce)
                {
                    StopCoroutine(pogoCoroutine);
                    PogoBounce();
                }
                int newBounceCount = Mathf.Min(bounceCount + 1, maxBounceCount);
                if (newBounceCount > bounceCount)
                {
                    bounceCount = newBounceCount;
                    camRadius  *= 1.1f;
                    UpdatePogoBounceLevelText();
                    maxHeight = 0f;
                }
            }
            else
            {
                Debug.Log("Bad bounce");
                bounceState = PogoBounceState.Bad;
            }
        }