//edited add reference to SoundManager
    //public SoundManager soundManager;

    void Awake()
    {
        if (intance == null)
        {
            intance = this;
        }
    }
 public ExcelExportEditor()
 {
     SettingUI           = new SettingUI(this);
     ExportProcessUI     = new ExportProcessUI(this);
     PriorityConfig      = new PriorityConfig();
     SingleExcelConfigUI = new SingleExcelConfigUI(this);
     OneKeyExportUI      = new ExcelOneKeyExportUI(this);
 }
    private void OnGUI()
    {
        if (ExportProcessUI.ExportProcessMode != ExportProcessUI.ProcessMode.None)
        {
            ExportProcessUI.ExportProcess();
            return;
        }

        PriorityConfig.LoadPriorityConfig();
        if (SingleExcelConfigUI.ShowSingleExcelUI)
        {
            SingleExcelConfigUI.ShowSingleExcelConfigUI();
            return;
        }

        var iconExcel   = LoadTexture("Excel.png");
        var iconSetting = LoadTexture("Setting.png");

        GUIContent[] guiObjs =
        {
            new GUIContent(iconExcel,   "Excel Export"),
            new GUIContent(iconSetting, "Excel Export Setting"),
        };

        GUILayoutOption[] options =
        {
            GUILayout.Width(100),
            GUILayout.Height(44),
        };
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        m_ToolMode = (ToolMode)GUILayout.Toolbar((int)m_ToolMode, guiObjs, options);
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        SettingUI.LoadCSSettingConfig();

        if (m_LastToolMode != m_ToolMode)
        {
            EditorGUI.FocusTextInControl("");
            m_LastToolMode = m_ToolMode;
        }
        switch (m_ToolMode)
        {
        case ToolMode.Excel:
            OneKeyExportUI.ExcelOneKeyExportEditorUI();
            break;

        case ToolMode.Setting:
            SettingUI.SettingModeUI();
            break;
        }
    }
        void OnPreprocessTexture()
        {
            string    saveDirectory = CommonTools.GetDirectoryPath(assetPath);
            SettingUI setting       = EditorSetting.Instance.setting.settingUI;

            if (null != setting)
            {
                Log(setting.ToString());

                if (setting.asset_root.IndexOf(saveDirectory) >= 0)
                {
                    Log("is UI Import");
                }
                else
                {
                    Log("not ui");
                }
            }
        }
Exemple #5
0
        private void Update()
        {
            // ESC 键
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                if (RuntimeConfig.UI_Config.overlay != null && RuntimeConfig.UI_Config.overlay.Created && RuntimeConfig.UI_Config.overlay.IsActive)
                {
                    ToggleUI = true;
                }
            }

            // UI Hotkey
            if (Settings.Hotkey.OpenUI.Value.IsDown() || ToggleUI)
            {
                ToggleUI = false;

                if (RuntimeConfig.UI_Config.overlay != null && RuntimeConfig.UI_Config.overlay.Created)
                {
                    RuntimeConfig.UI_Config.overlay.RectTransform.SetAsLastSibling();
                    if (RuntimeConfig.UI_Config.overlay.IsActive)
                    {
                        RuntimeConfig.UI_Config.overlay.SetActive(false);
                        Settings.Save();
                    }
                    else
                    {
                        RuntimeConfig.UI_Config.overlay.SetActive(true);
                        AudioManager.instance.PlaySE("SE_BUTTONDEFAULT");
                    }
                }
                else
                {
                    SettingUI.PrepareGUI();
                    var parent = GameObject.Find("/UIRoot/Canvas/UIPopup").transform;
                    RuntimeConfig.UI_Config.overlay.SetParent(parent);
                    RuntimeConfig.UI_Config.overlay.GameObject.layer               = 5;
                    RuntimeConfig.UI_Config.overlay.RectTransform.anchorMax        = new Vector2(0.5f, 0.5f);
                    RuntimeConfig.UI_Config.overlay.RectTransform.anchorMin        = new Vector2(0.5f, 0.5f);
                    RuntimeConfig.UI_Config.overlay.RectTransform.anchoredPosition = Vector2.zero;
                }
            }
        }
Exemple #6
0
        private void renderSettingsControls()
        {
            int i = 1;

            foreach (TV3DSetting s in settings)
            {
                Label l = new Label();
                l.Text  = s.option.ToString();
                l.Top   = i * 28;
                l.Width = 200;
                l.Left  = 10;
                Control c;

                if (s.type.IsEnum)
                {
                    c = new ComboBox();
                    foreach (object o in Enum.GetNames(s.type))
                    {
                        (c as ComboBox).Items.Add(o);
                    }
                }
                else if (s.type == typeof(bool))
                {
                    c = new CheckBox();
                }
                else
                {
                    throw new Exception("[" + s.type.ToString() + "] not supported");
                }
                c.Left  = 250;
                c.Width = 200;
                c.Top   = i * 28;
                this.panel1.Controls.Add(l);
                this.panel1.Controls.Add(c);

                setControlValue(c, s.value);

                settingUIWidgets[i - 1] = new SettingUI(s.option.ToString(), c);
                i++;
            }
        }
Exemple #7
0
    private void Start()
    {
        questionBtn.onClick.AddListener(() => {
            SoundManager.manager.PlayMusicByPath(GameController.manager.accountMan.selfInfo.sex + "9001");
            questionUI.gameObject.SetActive(true);
        });
        settingBtn.onClick.AddListener(() => {
            SetPageType(IndexPageType.Setting);
        });

        avatarBtn.onClick.AddListener(() => {
            SetPageType(IndexPageType.Avatar);
        });
        voiceBtn.onClick.AddListener(() => {
            SetPageType(IndexPageType.Voice);
            Debug.Log(GameController.manager.accountMan.selfInfo.sex + "=======");
            SoundManager.manager.PlayMusicByPath(GameController.manager.accountMan.selfInfo.sex + "9002");
        });
        studyBtn.onClick.AddListener(() => {
            IndexUICtrl.instance.SetPageType(PageType.Study);
        });
        musicBtn.onClick.AddListener(() => {
            IndexUICtrl.instance.SetPageType(PageType.Music);
        });
        subjectBtn.onClick.AddListener(() => {
            IndexUICtrl.instance.SetPageType(PageType.Subject);
        });
        paintBtn.onClick.AddListener(() => {
            IndexUICtrl.instance.SetPageType(PageType.Paint);
        });
        reportBtn.onClick.AddListener(() => {
            IndexUICtrl.instance.SetPageType(PageType.Report);
        });
        reportBtnAdmin.onClick.AddListener(() => {
            //IndexUICtrl.instance.SetPageType(PageType.Report);
            IndexUICtrl.instance.SetPageType(PageType.UserList);
        });
        breatheBtn.onClick.AddListener(() => {
            GameController.manager.levelMan.selectInfo       = new LevelInfo();
            GameController.manager.levelMan.selectInfo.index = 2;
            GameController.manager.levelMan.selectInfo.bg    = Resources.Load <Sprite>("Level/game2Bg");
            SceneManager.LoadScene(2);
        });

        backBtn.onClick.AddListener(() => {
            if (curPageType == IndexPageType.Setting)
            {
                SettingUI setting = pages[(int)IndexPageType.Setting].GetComponent <SettingUI>();
                if (setting.PageIdx == 0)
                {
                    SetPageType(IndexPageType.Main);
                    GameController.manager.accountMan.UpdateAccount(GameController.manager.accountMan.selfInfo);
                }
                else
                {
                    setting.ConfirmPassword();
                }
            }
            else if (curPageType == IndexPageType.Avatar)
            {
                avatarUI.OnBackBtnClick(() => {
                    SetPageType(IndexPageType.Main);
                });
            }
            else
            {
                SetPageType(IndexPageType.Main);
            }
        });

        for (int i = 0; i < voiceBtns.Count; i++)
        {
            int id = i;
            voiceBtns[i].onClick.AddListener(() => {
                GameController.manager.voiceType = id + 1;
                SetPageType(IndexPageType.Level);
                SoundManager.manager.PlayMusicByPath(GameController.manager.accountMan.selfInfo.sex + "9003");
            });
        }


        SetPageType(IndexPageType.Main);

        InitSelectGame();
        InitAvatar();
        InitOperation();

        if (GameController.manager.curIdentityType == IdentityType.Admin)
        {
            avatarBtn.interactable = false;
        }

        if (GameController.manager.enterFromGame)
        {
            SetPageType(IndexPageType.Level);
        }
    }
Exemple #8
0
		private void renderSettingsControls()
		{
			int i = 1;
			foreach(TV3DSetting s in settings)
			{
				Label l = new Label();
				l.Text = s.option.ToString();
				l.Top = i * 28;
				l.Width = 200;
				l.Left = 10;
				Control c;
				
				if(s.type.IsEnum)
				{
					c = new ComboBox();
					foreach(object o in Enum.GetNames(s.type))
					{
						(c as ComboBox).Items.Add(o);
					}
				}
				else if(s.type == typeof(bool))
				{
					c = new CheckBox();
				}
				else
				{
					throw new Exception("[" + s.type.ToString() + "] not supported");
				}
				c.Left = 250;
				c.Width = 200;
				c.Top = i * 28;
                this.panel1.Controls.Add(l);
				this.panel1.Controls.Add(c);

				setControlValue(c, s.value);

				settingUIWidgets[i-1] = new SettingUI(s.option.ToString(), c);
				i++;
			}
		}
Exemple #9
0
 public ToolSetting() : base(typeof(SettingUI))
 {
     instance = this;
     ui       = uistate as SettingUI;
 }
Exemple #10
0
 void Awake()
 {
     instance = this;
 }