Start using new input manager

This commit is contained in:
2025-06-04 22:05:39 -07:00
parent 966586f770
commit 59c8ce99ca
3 changed files with 43 additions and 78 deletions

View File

@@ -17,52 +17,17 @@ public class GamePlayerPauseMenu : MonoBehaviour
{
UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("MainMenu");
});
continueButton.onClick.AddListener(Unpause);
musicSlider.onValueChanged.AddListener((float value) =>
continueButton.onClick.AddListener(GamePlayer.instance.DisablePause);
musicSlider.onValueChanged.AddListener(value =>
{
PlayerPrefs.SetFloat("musicVolume", value);
PlayerPrefs.Save();
songLoop.volume = value;
});
sfxSlider.onValueChanged.AddListener((float value) =>
sfxSlider.onValueChanged.AddListener(value =>
{
PlayerPrefs.SetFloat("sfxVolume", value);
PlayerPrefs.Save();
});
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
gameObject.SetActive(false);
}
}
void Unpause()
{
songLoop.UnPause();
gameObject.SetActive(false);
GameObject[] berries = GameObject.FindGameObjectsWithTag("Berry");
GameObject[] poisonberries = GameObject.FindGameObjectsWithTag("PoisonBerry");
GameObject[] ultraberries = GameObject.FindGameObjectsWithTag("UltraBerry");
GameObject[] slownessberries = GameObject.FindGameObjectsWithTag("SlowBerry");
foreach (GameObject b in berries)
{
b.GetComponent<Rigidbody2D>().linearVelocity = new Vector2(0, -3);
}
foreach (GameObject pb in poisonberries)
{
pb.GetComponent<Rigidbody2D>().linearVelocity = new Vector2(0, -3);
}
foreach (GameObject ub in ultraberries)
{
ub.GetComponent<Rigidbody2D>().linearVelocity = new Vector2(0, -3);
}
foreach (GameObject sb in slownessberries)
{
sb.GetComponent<Rigidbody2D>().linearVelocity = new Vector2(0, -3);
}
}
}