Ejemplo n.º 1
0
        private void CheckForRebinds()
        {
            Key selectedKey = Key.None;

            foreach (KeyCode keyCode in Enum.GetValues(typeof(KeyCode)))
            {
                if (keyCode != KeyCode.Escape && Input.GetKeyDown(keyCode))
                {
                    selectedKey = Array.Find(KeyInfo.KeyList, keyInfo => Array.Exists(keyInfo.keyCodes, containedCode => containedCode == keyCode)).Key;
                }
            }
            if (selectedKey != Key.None)
            {
                switch (inputRebinding)
                {
                case UP:
                    ControlBindingContainer.GetInstance().upKey = selectedKey;
                    break;

                case DOWN:
                    ControlBindingContainer.GetInstance().downKey = selectedKey;
                    break;

                case LEFT:
                    ControlBindingContainer.GetInstance().leftKey = selectedKey;
                    break;

                case RIGHT:
                    ControlBindingContainer.GetInstance().rightKey = selectedKey;
                    break;

                case JUMP:
                    ControlBindingContainer.GetInstance().jumpKey = selectedKey;
                    break;

                case ACTION:
                    ControlBindingContainer.GetInstance().actionKey = selectedKey;
                    break;

                case LIGHT:
                    ControlBindingContainer.GetInstance().lightKey = selectedKey;
                    break;

                case CLING:
                    ControlBindingContainer.GetInstance().clingKey = selectedKey;
                    break;
                }
                ControlBindingContainer.SaveInstance();
                isRebinding = false;
                InitializePanel();
                if (inputManager != null)
                {
                    inputManager.ResetActionSet();
                }
            }
        }
Ejemplo n.º 2
0
 public void SetVolume()
 {
     ControlBindingContainer.GetInstance().musicVolume = musicSlider.value;
     ControlBindingContainer.SaveInstance();
     lobbyMusicBehavior.LoadVolume();
     if (musicManager != null)
     {
         musicManager.ResetMusicVolume();
     }
 }
Ejemplo n.º 3
0
 public void SetEffectVolume()
 {
     ControlBindingContainer.GetInstance().effectVolume = effectSlider.value;
     ControlBindingContainer.SaveInstance();
 }
Ejemplo n.º 4
0
 public void SetVolume()
 {
     ControlBindingContainer.GetInstance().musicVolume = musicSlider.value;
     ControlBindingContainer.SaveInstance();
     lobbyMusicBehavior.LoadVolume();
 }