Exemplo n.º 1
0
    private void Start()
    {
        if (pauseScreen != null)
        {
            pauseScreen.SetActive(false);
        }

        SwapImages swapSpritesBGM = toggleMusicBtn.GetComponent <SwapImages>();

        swapSpritesBGM.Swap(AudioManager.instance.HasBGM);
        toggleMusicBtn.onClick.AddListener(AudioManager.instance.ToggleMuteBGM);
        toggleMusicBtn.onClick.AddListener(delegate() { swapSpritesBGM.Swap(AudioManager.instance.HasBGM); });

        SwapImages swapSpritesSFX = toggleSFXBtn.GetComponent <SwapImages>();

        swapSpritesSFX.Swap(AudioManager.instance.HasSFX);
        toggleSFXBtn.onClick.AddListener(AudioManager.instance.ToggleMuteSFX);
        toggleSFXBtn.onClick.AddListener(delegate() { swapSpritesSFX.Swap(AudioManager.instance.HasSFX); });

        restartBtn.onClick.AddListener(Restart);

        homeBtn.onClick.AddListener(Home);
    }
Exemplo n.º 2
0
    private void Start()
    {
        SwapImages swapSpritesBGM = toggleMusicBtn.GetComponent <SwapImages>();

        swapSpritesBGM.Swap(AudioManager.instance.HasBGM);
        toggleMusicBtn.onClick.AddListener(AudioManager.instance.ToggleMuteBGM);
        toggleMusicBtn.onClick.AddListener(delegate() { swapSpritesBGM.Swap(AudioManager.instance.HasBGM); });

        SwapImages swapSpritesSFX = toggleSFXBtn.GetComponent <SwapImages>();

        swapSpritesSFX.Swap(AudioManager.instance.HasSFX);
        toggleSFXBtn.onClick.AddListener(AudioManager.instance.ToggleMuteSFX);
        toggleSFXBtn.onClick.AddListener(delegate() { swapSpritesSFX.Swap(AudioManager.instance.HasSFX); });

        godModeBtn.onClick.AddListener(ToggleGodMode);
        if (LevelManager.instance.GodModeOn)
        {
            slash.gameObject.SetActive(false);
        }
        else
        {
            slash.gameObject.SetActive(true);
        }
    }