コード例 #1
0
        public void ResetInputs()
        {
            mSuspendUpdates = true;

            if (SavingNew)
            {
                CreateNewSettingButton.gameObject.SetActive(false);
                CancelCreateNewButton.gameObject.SetActive(true);
                SaveCustomSettingsButton.gameObject.SetActive(true);
                CustomSettingNameInput.gameObject.SetActive(true);
            }
            else
            {
                CreateNewSettingButton.gameObject.SetActive(true);
                CancelCreateNewButton.gameObject.SetActive(false);
                SaveCustomSettingsButton.gameObject.SetActive(false);
                CustomSettingNameInput.gameObject.SetActive(false);
            }

            if (CurrentDifficultySetting == null || SavingNew)
            {
                Debug.Log("Current setting has not been customized, not setting inputs");
                GlobalVariableNameLabel.text = "(Click a global setting to edit)";
                GlobalVariableTypeLabel.text = string.Empty;
                GlobalVariableDescLabel.text = string.Empty;
                BooleanInput.gameObject.SetActive(false);
                IntegerInput.gameObject.SetActive(false);
                DecimalInput.gameObject.SetActive(false);
                ApplyChangesButton.gameObject.SetActive(false);
                RemoveSettingButton.gameObject.SetActive(false);
            }
            else
            {
                //enable custom saving
                if (mSelectedObject == null)
                {
                    GlobalVariableNameLabel.text = "(Click a global setting to edit)";
                    GlobalVariableTypeLabel.text = string.Empty;
                    GlobalVariableDescLabel.text = string.Empty;
                    ApplyChangesButton.gameObject.SetActive(false);
                    RemoveSettingButton.gameObject.SetActive(false);
                }
                DifficultyLabel.text = SelectedDifficultyName;
                DeathStyleLabel.text = CurrentDifficultySetting.DeathStyle.ToString();
                FallDamageStyle.text = CurrentDifficultySetting.FallDamage.ToString();
            }

            for (int i = 0; i < TagCheckboxes.Count; i++)
            {
                if (TagCheckboxes[i].gameObject.activeSelf)
                {
                    if (CurrentDifficultySetting.IsDefined(TagCheckboxes[i].gameObject.name))
                    {
                        TagCheckboxes[i].isChecked = true;
                    }
                    else
                    {
                        TagCheckboxes[i].isChecked = false;
                    }
                }
            }

            mSuspendUpdates = false;
        }