Exemplo n.º 1
0
    public void OnImportFile()
    {
        string filePath = ToolFunction.OpenFilePath("*.txt", "打开文件", ".txt");

        ConfigCenter.Instance().AddHistoryFile(filePath);
        GetComponent <MovieCatalogueScript>().AddListItembByFileName(filePath);
    }
    public void BtnYes()
    {
        var filepath = m_DeleteObj.GetComponent <ClickMovieListItem>().GetFilePath();

        ConfigCenter.Instance().DeleteFileByPath(filepath);
        var temphead     = FileReader.GetHeadFromFile(filepath);
        var portraitpath = ToolFunction.GetDefaultPortraitPathByName(temphead.strPortrait, ".jpg");

        if (File.Exists(portraitpath))
        {
            File.Delete(portraitpath);
        }
        if (File.Exists(filepath))
        {
            File.Delete(filepath);
        }
        Destroy(m_DeleteObj);
        Destroy(gameObject);
    }
Exemplo n.º 3
0
    public void Btn_Save()
    {
        if (string.IsNullOrEmpty(m_InputDoctorName.text) ||
            string.IsNullOrEmpty(m_InputFilePath.text))
        {
            m_InputDoctorName.placeholder.GetComponent <Text>().color = Color.red;
            m_InputFilePath.placeholder.GetComponent <Text>().color   = Color.red;
        }
        else
        {
            //根据输入的文件名和选择的头像,将文件存储到默认存储文件夹,将头像图片复制到默认头像存储文件夹
            m_FilePath = ToolFunction.GetMovieSaveFilePath(m_InputFilePath.text, ".txt");
            var tempPortrait = ToolFunction.GenerateStringID();
            ToolFunction.ImageSaveLocal(m_PortraitImage.mainTexture, ToolFunction.GetDefaultPortraitPathByName(tempPortrait, ".jpg"));
            int           tempTimeCount = m_RecordManager.GetFrameCount();
            int           tempStartTime = (int)(tempTimeCount * m_fLeftSliderValue);
            int           tempEndTime   = (int)(tempTimeCount * m_fRightSliderValue);
            MovieHeadData tempData      = new MovieHeadData(
                "MOVIE_DATA",
                m_InputDoctorName.text,
                tempPortrait,
                System.DateTime.Now.ToString("MM/dd/yyyy H:mm:ss"),
                tempEndTime - tempStartTime,
                0,
                ConfigCenter.Instance().GetFPS()
                );
            m_RecordManager.SaveDataToFile(
                tempData,
                m_FilePath,
                tempStartTime,
                tempEndTime
                );

            m_SavePanel.SetActive(false);
            m_InfoSaved.SetActive(true);
        }
    }
 private void Start()
 {
     ListMovieByDirectory(ConfigCenter.Instance().GetDefaultDirPath());
     ListMovieByFileNames(ConfigCenter.Instance().GetHistoryFilePathList());
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Awake()
 {
     ConfigCenter.Instance().ConfigDataInit(DataPath.strConfigFilePath);
     Application.targetFrameRate = ConfigCenter.Instance().GetFPS();
 }