public void LosdScriptEngine(string fileName, Action onFinish)
        {
            string            path              = "AdventureScene/Text/" + fileName;
            TextAsset         textAsset         = AssetDataMng.Instance().LoadObject(path, null, true) as TextAsset;
            FileControlHelper fileControlHelper = new FileControlHelper();

            AppCoroutine.Start(fileControlHelper.Decrypt(textAsset.bytes, new Action <byte[]>(this.OnLoadScriptFile)), onFinish, false);
        }
 protected IEnumerable GetFileSystemEntryItems(List <FileSystemInfo> directoriesAndFiles)
 {
     return(FileControlHelper.GetFileSystemEntryItems(
                directoriesAndFiles,
                m_controller,
                GroupFoldersAndFiles,
                fileInfo => fileInfo.FullName == m_controller.CurrentFileFullName
                ));
 }
        protected override IEnumerable GetFileSystemEntryItems()
        {
            ISet <string> fileNames = new HashSet <string>(m_controller.SelectedFiles.Select(fileInfo => fileInfo.FullName.ToLower()));

            return(FileControlHelper.GetFileSystemEntryItems(
                       m_controller.DirectoriesAndFiles,
                       m_controller,
                       GroupFoldersAndFiles,
                       fileInfo => fileNames.Contains(fileInfo.FullName.ToLower())
                       ));
        }
Beispiel #4
0
    public IEnumerator InitializeScript(string fileName)
    {
        ScriptEngine scriptEngine = new ScriptEngine();

        this.scriptEngine = scriptEngine;
        string            path              = "AdventureScene/Text/Guidance/" + fileName;
        TextAsset         textAsset         = AssetDataMng.Instance().LoadObject(path, null, true) as TextAsset;
        FileControlHelper fileControlHelper = new FileControlHelper();

        return(fileControlHelper.Decrypt(textAsset.bytes, new Action <byte[]>(this.OnLoadScriptFile)));
    }
 public PersistentFile(bool iCloudBackup)
 {
     this.fileControlHelper = new FileControlHelper();
     if (PlayerPrefs.HasKey("uuid"))
     {
         string @string = PlayerPrefs.GetString("uuid");
         int    num     = 8;
         if (num <= @string.Length)
         {
             byte[] array  = new byte[num];
             byte[] array2 = new byte[num];
             Encoding.ASCII.GetBytes(@string, 0, num, array, 0);
             Encoding.ASCII.GetBytes(@string, @string.Length - num, num, array2, 0);
             this.fileControlHelper.SetCryptoData(array, array2);
         }
     }
     else
     {
         this.fileControlHelper.SetCryptoData(null, null);
     }
     this.iCloudBackup = iCloudBackup;
 }
    protected IEnumerator LoadScriptFile(string fileName, Action <string> onCompleted)
    {
        string          filePath     = this.GetFilePath(fileName);
        TextAsset       textAsset    = AssetDataMng.Instance().LoadObject(filePath, null, true) as TextAsset;
        Action <byte[]> onCompleted2 = delegate(byte[] loadData)
        {
            string empty = string.Empty;
            try
            {
                TypeSerializeHelper.BytesToData <string>(loadData, out empty);
            }
            catch
            {
                global::Debug.Log("チュートリアルファイルの読み込みに失敗しました。");
            }
            if (onCompleted != null)
            {
                onCompleted(empty);
            }
        };
        FileControlHelper fileControlHelper = new FileControlHelper();

        return(fileControlHelper.Decrypt(textAsset.bytes, onCompleted2));
    }
 protected void UpdateFileFiltersVisibility()
 {
     FileControlHelper.UpdateFileFiltersVisibility(m_fileFiltersComboBox);
 }