Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        askingForFile = false;

        //if (chartPanel == null)
        //{
        //    Debug.LogError("No ChartPanel in Scene, please add one.");
        //}
        //chartPanel.SetActive(false);
        //if (chartKeeper == null)
        //{
        //    chartKeeper = FindObjectOfType<ChartKeeper>();
        //}

        if (fileChooser == null)
        {
            fileChooser = FindObjectOfType <FileDialogController>();
            if (fileChooser == null)
            {
                Debug.LogError("No FileDialog in Scene, please add one.");
            }
        }

        if (logController == null)
        {
            logController = FindObjectOfType <LogController>();
            if (logController == null)
            {
                Debug.LogError("No LogController in Scene, please add one.");
            }
        }
    }
Exemplo n.º 2
0
 public void AddNewFile()
 {
     if (subjectDir == null && SubjectTitleText.text.Trim().Length == 0)
     {
         messageController.SetMessage("請先填寫主題名稱");
         return;
     }
     FileDialogController.SelectMediaFile(OnSelectFile, "選擇多媒體檔案");
 }
Exemplo n.º 3
0
 private void OnSelectFile(string filepath)
 {
     isSelectVideo = filepath.Contains(".mp4");
     if (isSelectVideo)
     {
         selectVideoFilePath = filepath;
         FileDialogController.SelectImageFile(OnSelectVideoImageFile, "選擇影片截圖");
     }
     else
     {
         subjectDir.Create();
         FileInfo fileInfo    = new FileInfo(filepath);
         string   newFilePath = subjectDir.FullName + (("" + (itemFiles == null?0:itemFiles.Length)).PadLeft(3, '0')) + "__img__100" + fileInfo.Extension;
         fileInfo.CopyTo(newFilePath);
         itemFiles = subjectDir.GetFiles().Where(f => allowedExtensions.Contains(f.Extension.ToLower())).OrderBy(f => f.Name).ToArray();
         AddItem(itemFiles.Length, new FileInfo(newFilePath), ListContent);
     }
 }
    // Use this for initialization
    void Start()
    {
        askingForFile = false;

        if (fileChooser == null)
        {
            fileChooser = FindObjectOfType <FileDialogController>();
            if (fileChooser == null)
            {
                Debug.LogError("No FileDialog in Scene, please add one.");
            }
        }

        if (logController == null)
        {
            logController = FindObjectOfType <LogController>();
            if (logController == null)
            {
                Debug.LogError("No LogController in Scene, please add one.");
            }
        }
    }
Exemplo n.º 5
0
 public void SelectProjectorSlideFile()
 {
     FileDialogController.SelectImageFile(OnSelectProjectSlideFile, "選擇圖片");
 }