Beispiel #1
0
        private void Awake()
        {
            // Play Button:
            transform.Find("PlayButton").GetComponent <Button>().onClick.AddListener(() => {
                GameSceneManager.LoadScene(GameSceneManager.SceneNames.GameScene);
            });

            // Quit Button:
            transform.Find("QuitButton").GetComponent <Button>().onClick.AddListener(() => {
                Application.Quit();
            });
        }
Beispiel #2
0
        protected override void Awake()
        {
            base.Awake();

            m_containerTransform = transform.Find("Container");

            m_dayStatsText_TMP  = m_containerTransform.Find("DayStatsText_TMP").GetComponent <TextMeshProUGUI>();
            m_waveStatsText_TMP = m_containerTransform.Find("WaveStatsText_TMP").GetComponent <TextMeshProUGUI>();

            m_containerTransform.Find("RetryButton").GetComponent <Button>().onClick.AddListener(() => {
                GameSceneManager.LoadScene(GameSceneManager.SceneNames.GameScene);
            });

            m_containerTransform.Find("MainMenuButton").GetComponent <Button>().onClick.AddListener(() => {
                GameSceneManager.LoadScene(GameSceneManager.SceneNames.MainMenuScene);
            });
        }
Beispiel #3
0
        private void Awake()
        {
            m_soundVolumeText = transform.Find("SoundVolumeText_TMP").GetComponent <TextMeshProUGUI>();
            m_musicVolumeText = transform.Find("MusicVolumeText_TMP").GetComponent <TextMeshProUGUI>();

            // Sound Increase Button:
            transform.Find("SoundIncreaseButton").GetComponent <Button>().onClick.AddListener(() => {
                SoundManager.Instance.IncreaseVolume();
                UpdateVolumeText(m_soundVolumeText, SoundManager.Instance.GetVolume());
            });

            // Sound Decrease Button:
            transform.Find("SoundDecreaseButton").GetComponent <Button>().onClick.AddListener(() => {
                SoundManager.Instance.DecreaseVolume();
                UpdateVolumeText(m_soundVolumeText, SoundManager.Instance.GetVolume());
            });

            // Music Increase Button:
            transform.Find("MusicIncreaseButton").GetComponent <Button>().onClick.AddListener(() => {
                MusicManager.Instance.IncreaseVolume();
                UpdateVolumeText(m_musicVolumeText, MusicManager.Instance.GetVolume());
            });

            // Music Decrease Button:
            transform.Find("MusicDecreaseButton").GetComponent <Button>().onClick.AddListener(() => {
                MusicManager.Instance.DecreaseVolume();
                UpdateVolumeText(m_musicVolumeText, MusicManager.Instance.GetVolume());
            });

            // Main Menu Button:
            transform.Find("MainMenuButton").GetComponent <Button>().onClick.AddListener(() => {
                ToggleVisibility();
                GameSceneManager.LoadScene(GameSceneManager.SceneNames.MainMenuScene);
            });

            // Toggle Edge Scrolling:

            transform.Find("EdgeScrollingToggle").GetComponent <Toggle>().onValueChanged.AddListener((bool value) => {
                //UPDateToggle
                CameraHandler.Instance.SetEdgeScrollingEnabled(value);
            });
        }