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)); }
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)); }
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); }
private void Player_TapeCountIncrement(Platform.Effect effect) { Instantiate(tapePrefabs[(int)effect], tapePanels[(int)effect]); }
private void Player_TapeCountDecrement(Platform.Effect effect) { tapePanels[(int)effect].transform.GetChild(0).SetParent(null); }