public void CheckAndChange()
 {
     if (ApplicationModel.GetFileSysHead() == "Diary")
     {
         SceneManager.LoadScene("DiaryCutscene");
     }
 }
Exemplo n.º 2
0
    private void RefreshWindow()
    {
        ClearElements();

        //Debug.Log("Streaming Assets Path: "+Application.streamingAssetsPath);

        DirectoryInfo d = new DirectoryInfo(basePath + ApplicationModel.GetFileSysHead() + appendedPath);

        RefreshFolders(d);
        RefreshFiles(d);
    }
Exemplo n.º 3
0
    private void RefreshFiles(DirectoryInfo d)
    {
        FileInfo[] files = d.GetFiles();
        foreach (FileInfo file in files)
        {
            GameObject element = null;
            if (file.Name.EndsWith(".png") || file.Name.ToLower().EndsWith(".jpg"))
            {
                element = Instantiate(fseImage) as GameObject;
                element.SetActive(true);

                element.GetComponent <FSEImage>().SetName(file.Name);
                element.GetComponent <FSEImage>().SetPath(basePath + ApplicationModel.GetFileSysHead() + appendedPath + "/" + file.Name);

                element.transform.SetParent(fseImage.transform.parent, false);

                string passPath = file.FullName + ".password";
                if (File.Exists(passPath))
                {
                    string         jsonString = ReadFile(passPath);
                    FSPasswordInfo pass       = FSPasswordInfo.CreateFromJSON(jsonString);
                    element.GetComponent <FSEImage>().SetPasswordInfo(pass);
                    element.GetComponent <FSEImage>().Lock();
                }
            }
            else if (file.Name.EndsWith(".txt"))
            {
                element = Instantiate(fseTextfile) as GameObject;
                element.SetActive(true);

                element.GetComponent <FSETextfile>().SetName(file.Name);
                element.GetComponent <FSETextfile>().SetPath(basePath + ApplicationModel.GetFileSysHead() + appendedPath + "/" + file.Name);

                element.transform.SetParent(fseTextfile.transform.parent, false);

                string passPath = file.FullName + ".password";
                if (File.Exists(passPath))
                {
                    string         jsonString = ReadFile(passPath);
                    FSPasswordInfo pass       = FSPasswordInfo.CreateFromJSON(jsonString);
                    element.GetComponent <FSETextfile>().SetPasswordInfo(pass);
                    element.GetComponent <FSETextfile>().Lock();
                }
            }
            else if (file.Name.EndsWith(".mp4"))
            {
                element = Instantiate(fseVideo) as GameObject;
                element.SetActive(true);

                element.GetComponent <FSEVideo>().SetName(file.Name);
                element.GetComponent <FSEVideo>().SetPath(basePath + ApplicationModel.GetFileSysHead() + appendedPath + "/" + file.Name);

                element.transform.SetParent(fseVideo.transform.parent, false);

                string passPath = file.FullName + ".password";
                if (File.Exists(passPath))
                {
                    string         jsonString = ReadFile(passPath);
                    FSPasswordInfo pass       = FSPasswordInfo.CreateFromJSON(jsonString);
                    element.GetComponent <FSEVideo>().SetPasswordInfo(pass);
                    element.GetComponent <FSEVideo>().Lock();
                }
            }
            else if (file.Name.EndsWith(".wav")) //  || file.Name.EndsWith(".mp3"))
            {
                element = Instantiate(fseAudio) as GameObject;
                element.SetActive(true);

                element.GetComponent <FSEAudio>().SetName(file.Name);
                element.GetComponent <FSEAudio>().SetPath(basePath + ApplicationModel.GetFileSysHead() + appendedPath + "/" + file.Name);

                element.transform.SetParent(fseAudio.transform.parent, false);

                string passPath = file.FullName + ".password";
                if (File.Exists(passPath))
                {
                    string         jsonString = ReadFile(passPath);
                    FSPasswordInfo pass       = FSPasswordInfo.CreateFromJSON(jsonString);
                    element.GetComponent <FSEAudio>().SetPasswordInfo(pass);
                    element.GetComponent <FSEAudio>().Lock();
                }
            }
            else
            {
                //Debug.Log("File System Manager - Ignoring File: "+file.Name+" (Unhandled Filetype)");
            }
        }
    }