Exemplo n.º 1
0
    public void SecoundLastWorkedProject()
    {
        string jsonString = File.ReadAllText(ProjectPathFiles);

        //JsonUtility.FromJsonOverwrite (jsonString, OpenProjectData);
        string[] ProjectsPath = jsonString.Split('$');

        string getFirstProjectPath = OpenProjectData.OpenProjectsDataPaths;

        string[] ProjectPath = getFirstProjectPath.Split('$');
        Debug.Log("First Project path  " + ProjectPath.Length);

        CurrentFolderPath = ProjectsPath[1];
        LoadData.Load();

        DirectoryInfo d = new DirectoryInfo(ProjectsPath[0] + "/Data/ImageFile"); //Assuming Test is your Folder

        FileInfo[] Files = d.GetFiles("*.*");                                     //Getting Text files
        string     str   = "";

        foreach (FileInfo file in Files)
        {
            str = str + ", " + file.Name;
            Debug.Log("name is " + file.Name);
            Debug.Log("path is " + ProjectsPath[0] + "/Data/ImageFile/" + file.Name);
            openFileImage.loadExistingFile("file://" + ProjectsPath[0] + "/Data/ImageFile/" + file.Name, file.Name, false);
        }


        DirectoryInfo m = new DirectoryInfo(ProjectsPath[0] + "/Data/MovieFile"); //Assuming Test is your Folder

        FileInfo[] FilesM = m.GetFiles("*.*");                                    //Getting Text files
        string     strM   = "";

        foreach (FileInfo fileM in FilesM)
        {
            strM = strM + ", " + fileM.Name;
            Debug.Log("name is " + fileM.Name);
            Debug.Log("path is " + ProjectsPath[0] + "/Data/MovieFile/" + fileM.Name);
            openFileImage.loadExistingFile("file://" + ProjectsPath[0] + "/Data/MovieFile/" + fileM.Name, fileM.Name, false);
        }

        DirectoryInfo u = new DirectoryInfo(ProjectsPath[0] + "/Data/UnityFile"); //Assuming Test is your Folder

        FileInfo[] FilesU = u.GetFiles("*.*");                                    //Getting Text files
        string     strU   = "";

        foreach (FileInfo fileU in FilesU)
        {
            strU = strU + ", " + fileU.Name;
            Debug.Log("name is " + fileU.Name);
            Debug.Log("path is " + ProjectsPath[0] + "/Data/UnityFile/" + fileU.Name);
            openFileImage.loadExistingFile("file://" + ProjectsPath[0] + "/Data/UnityFile/" + fileU.Name, fileU.Name, true);
        }

        Debug.Log("Project path is " + ProjectsPath[0]);
    }
Exemplo n.º 2
0
    public void FaceBookLogin()
    {
        GetMethods.GetUserId(email, (id) => {
            if (id != "0")             // The user exits in the data base

            // Verify if an Update is necessary.
            {
                UpdateMethods.UpdateUsersDatabase(id, userName, age, AppManeger.instance.userGender.ToString(), (result) => {
                    Debug.Log(string.Format("Update {0}", result));
                });

                string fileName = string.Format("Prefs_{0}", AppManeger.instance.userID);

                //GetMethods.GetUserPrefs(id, (prefsResult) => {PrefsResult(prefsResult);}); // Check if the user are in the Prefs Database

                if (SaveLoadData.FileExits(fileName))                 // If exit

                {
                    SaveLoadData.Load(fileName, SaveLoadData.DataType.UserPrefs); // load from device
                    GoToCheersPanel();                                            // Means the user has everyting setted;
                }
                else
                {
                    GetMethods.GetUserPrefs(id, (prefsResult) => { PrefsResult(prefsResult); });                   // Check if the user are in the Prefs Database
                }
            }
            else                // User don't exit in the data base

            {
                PostMethods.InsertUserIntoUsersDatabase(userName, age, email, gender, (result) => {
                    InsertUserResult(result);
                });
            }
        });
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Awake()
    {
        playerProgression = gameObject.AddComponent <PlayerProgression> ();
        saveLoadData      = gameObject.AddComponent <SaveLoadData> ();
        saveLoadData.Load();

        SendMessage("AllDataComponentsAdded", SendMessageOptions.DontRequireReceiver);        //laat weten dat alle data dingen zijn geadd.
    }
Exemplo n.º 4
0
    void OnGUI()
    {
        DropDownNames.Clear();
        DropDownNames.Add("All");
        if (FI != null)
        {
            foreach (FileInfo I in FI)
            {
                DropDownNames.Add(Path.GetExtension(I.FullName));
            }
        }

        BigScrollPos = GUILayout.BeginScrollView(BigScrollPos, GUILayout.Width(Screen.width), GUILayout.Height(Screen.height));

        GUILayout.Label("Save/Load Data System Information", EditorStyles.boldLabel);
        GUILayout.Space(50);
        GUILayout.Label("Current Save Files", EditorStyles.boldLabel);
        DropDownSelection = EditorGUILayout.Popup("File Extensions", DropDownSelection, DropDownNames.ToArray(), GUILayout.Width(400));
        GUILayout.BeginArea(new Rect(10, 130, 485, 200), EditorStyles.helpBox);
        ScrollPos = GUILayout.BeginScrollView(ScrollPos, GUILayout.Width(480), GUILayout.Height(194));
        GUILayout.BeginVertical();
        if (FI == null)
        {
            GUILayout.EndVertical(); GUILayout.EndScrollView(); GUILayout.EndArea(); return;
        }
        foreach (FileInfo I in FI)
        {
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (Path.GetExtension(I.FullName) == DropDownNames[DropDownSelection] || DropDownNames[DropDownSelection] == "All")
            {
                if (GUILayout.Button(I.Name, GUILayout.Width(400), GUILayout.Height(30)))
                {
                    object obj = SaveLoadData.Load <object>(Path.GetFileNameWithoutExtension(I.Name));
                    DataList = LoadAndWrite(obj, I.Name.Split('.')[0], 10);
                }
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }
        GUILayout.EndVertical();
        GUILayout.EndScrollView();
        GUILayout.EndArea();

        GUILayout.Space(250);
        GUILayout.Label("File Data", EditorStyles.boldLabel);
        GUILayout.BeginArea(new Rect(10, 400, 505, 400), EditorStyles.helpBox);

        DataScroll = GUILayout.BeginScrollView(DataScroll, GUILayout.Width(495), GUILayout.Height(394));

        if (DataList != null)
        {
            GUILayout.TextArea(DataList);
        }
        GUILayout.EndScrollView();

        GUILayout.EndArea();
        GUILayout.Space(600);

        GUILayout.EndScrollView();
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     SaveLoadData.Load();
 }
Exemplo n.º 6
0
 void LoadFiles()
 {
     myData     = SaveLoadData.Load();
     texty.text = myData.uniqueTruckID.ToString();
 }