コード例 #1
0
        override public void Awake()
        {
            try
            {
                Directory.CreateDirectory(PRESET_DIR);

                this.savePanes = new List <SavePane>();

                this.languageBox                       = new CustomComboBox(Translation.GetTranslations());
                this.languageBox.Text                  = Translation.GetText("UI", "language");
                this.languageBox.SelectedItem          = Translation.CurrentTranslation;
                this.languageBox.SelectedIndexChanged += this.ChangeLanguage;
                this.ChildControls.Add(this.languageBox);

                this.saveButton        = new CustomButton();
                this.saveButton.Text   = Translation.GetText("UI", "save");
                this.saveButton.Click += SaveEnv;
                this.ChildControls.Add(this.saveButton);

                this.nameTextField      = new CustomTextField();
                this.nameTextField.Text = Translation.GetText("UI", "name");
                this.ChildControls.Add(this.nameTextField);

                this.loadTargetLabel          = new CustomLabel();
                this.loadTargetLabel.FontSize = this.FontSize;
                this.loadTargetLabel.Text     = Translation.GetText("UI", "loadTarget");
                this.ChildControls.Add(this.loadTargetLabel);

                this.loadEffectsCheckbox                 = new CustomToggleButton(true);
                this.loadEffectsCheckbox.Text            = Translation.GetText("UI", "loadEffects");
                this.loadEffectsCheckbox.CheckedChanged += ChangeLoadTargets;
                this.ChildControls.Add(this.loadEffectsCheckbox);

                this.loadLightsCheckbox                 = new CustomToggleButton(true);
                this.loadLightsCheckbox.Text            = Translation.GetText("UI", "loadLights");
                this.loadLightsCheckbox.CheckedChanged += ChangeLoadTargets;
                this.ChildControls.Add(this.loadLightsCheckbox);

                this.loadModelsCheckbox                 = new CustomToggleButton(true);
                this.loadModelsCheckbox.Text            = Translation.GetText("UI", "loadModels");
                this.loadModelsCheckbox.CheckedChanged += ChangeLoadTargets;
                this.ChildControls.Add(this.loadModelsCheckbox);

                this.loadCameraCheckbox                 = new CustomToggleButton(true);
                this.loadCameraCheckbox.Text            = Translation.GetText("UI", "loadCamera");
                this.loadCameraCheckbox.CheckedChanged += ChangeLoadTargets;
                this.ChildControls.Add(this.loadCameraCheckbox);

                this.loadMiscCheckbox                 = new CustomToggleButton(true);
                this.loadMiscCheckbox.Text            = Translation.GetText("UI", "loadMisc");
                this.loadMiscCheckbox.CheckedChanged += ChangeLoadTargets;
                this.ChildControls.Add(this.loadMiscCheckbox);

                this.wasPresetLoaded = false;

                this.ReloadSaves();
                this.ChangeLoadTargets(this, new EventArgs());
            }
            catch (Exception e)
            {
                Debug.LogError(e.ToString());
            }
        }