コード例 #1
0
 //注册事件
 void InitializationEvent()
 {
     m_Input_ChoiceFile.onClick.AddListener(() =>
     {
         var path = OpenDialog.OpenFile();
         if (!string.IsNullOrEmpty(path))
         {
             m_Inpath_Input.text = path;
         }
     });
     m_Input_ChoiceDir.onClick.AddListener(() =>
     {
         var path = OpenDialog.OpenDir();
         if (!string.IsNullOrEmpty(path))
         {
             m_Inpath_Input.text = path;
         }
     });
     m_Output_Choice.onClick.AddListener(() =>
     {
         var path = OpenDialog.OpenDir();
         if (!string.IsNullOrEmpty(path))
         {
             m_Outpath_Input.text = path;
         }
     });
     m_Outpath_UseSource.onValueChanged.AddListener((isOn) =>
     {
         m_Outpath_Input.interactable = !isOn;
         m_Output_Choice.interactable = !isOn;
         m_Output_Copy.interactable   = !isOn;
     });
     m_Output_Copy.onClick.AddListener(() => {
         if (!string.IsNullOrEmpty(m_Inpath_Input.text))
         {
             m_Outpath_Input.text = Directory.Exists(m_Inpath_Input.text) ? m_Inpath_Input.text : Path.GetDirectoryName(m_Inpath_Input.text);
         }
     });
 }