Esempio n. 1
0
    void TryApplyUpgrade(Platform.Effect effect)
    {
        if (player.tapeInventory[(int)effect] <= 0)
        {
            player.SetState(player.moveState);
            return;
        }

        Platform hitPlatform;

        if (effect != Platform.Effect.NONE)
        {
            hitPlatform = player.GetInteractablePlatform((Platform p) =>
            {
                return(p.isFixed && p.currentEffect == Platform.Effect.NONE);
            });
        }
        else
        {
            hitPlatform = player.GetInteractablePlatform((Platform p) =>
            {
                return(!p.isFixed);
            });
        }

        if (hitPlatform == null)
        {
            player.SetState(player.moveState);
            return;
        }

        player.StartCoroutine(UpgradePlatform(hitPlatform, effect));
    }
Esempio n. 2
0
    private void TryApplyDonwgrade(Platform.Effect effect)
    {
        Platform hitPlatform = player.GetInteractablePlatform((Platform p) =>
        {
            return(p.isFixed);
        });

        if (hitPlatform == null)
        {
            player.SetState(player.moveState);
            return;
        }

        player.StartCoroutine(DowngradePlatform(hitPlatform));
    }
Esempio n. 3
0
    IEnumerator UpgradePlatform(Platform platform, Platform.Effect effect)
    {
        if (effect == Platform.Effect.NONE)
        {
            player.tapeAudio.PlayRandomClip(player.audioSource);
        }
        else
        {
            player.specialTapeAudio.PlayRandomClip(player.audioSource);
        }
        player.animator?.SetTrigger("Upgrade");
        yield return(new WaitForSeconds(0.5f));

        player.RemoveTape(effect);

        platform.isFixed       = true;
        platform.currentEffect = effect;
        player.SetState(player.moveState);
    }
Esempio n. 4
0
 private void Player_TapeCountIncrement(Platform.Effect effect)
 {
     Instantiate(tapePrefabs[(int)effect], tapePanels[(int)effect]);
 }
Esempio n. 5
0
 private void Player_TapeCountDecrement(Platform.Effect effect)
 {
     tapePanels[(int)effect].transform.GetChild(0).SetParent(null);
 }