コード例 #1
0
    public override void SceneStart(Singleton instance)
    {
        // Check if we've already retrieve the settings
        if (settings != null)
        {
            // If so, don't do anything
            return;
        }

        // Retrieve settings
        settings      = Singleton.Get <GameSettings>();
        musicSettings = Singleton.Get <BackgroundMusic>();

        // Setup controls
        inSetupMode = true;
        musicControls.Setup(musicSettings.Volume, musicSettings.IsMuted);
        soundEffectsControls.Setup(SoundEffect.GlobalVolume, SoundEffect.GlobalMute);
        inSetupMode = false;

        // Setup update function
        if (updateAction != null)
        {
            instance.OnUpdate -= updateAction;
            updateAction       = null;
        }
        updateAction       = new System.Action <float>(UpdateOptions);
        instance.OnUpdate += updateAction;
    }
コード例 #2
0
        void Start()
        {
            // Check if we've already retrieve the settings
            if (settings != null)
            {
                // If so, don't do anything
                return;
            }

            // Retrieve settings
            settings = Singleton.Get <GameSettings>();

            // Setup controls
            inSetupMode = true;
            musicControls.Setup(BackgroundMusic.GlobalVolume, BackgroundMusic.GlobalMute);
            soundEffectsControls.Setup(SoundEffect.GlobalVolume, SoundEffect.GlobalMute);
            inSetupMode = false;
        }