예제 #1
0
    /// <summary>
    /// Initalizes the highscore list.
    /// </summary>
    void Start()
    {
        LoadData();
        //LoadMockupData();
        PlayerData currentPlayerData = PreferenceManager.ReadJsonFromPreferences <PlayerData>("player");

        AddItem(currentPlayerData);
        if (highscoreItem != null)
        {
            UpdateListView();
        }
        //Debug.Log("Finished Highscore Initialization");
    }
예제 #2
0
 /// <summary>
 /// Initializes the new Player with already stored player data or creates a new data instance.
 /// It also stores the start rotation and the start time.
 /// </summary>
 void Start()
 {
     data = PreferenceManager.ReadJsonFromPreferences <PlayerData>("player");
     if (data == null)
     {
         data = new PlayerData();
     }
     if (debugMode)
     {
         data = new PlayerData();
     }
     startTime     = Time.realtimeSinceStartup;
     startRotation = playerObject.transform.rotation;
 }
예제 #3
0
 /// <summary>
 /// Loads the data from the player preferences.
 /// </summary>
 public void LoadData()
 {
     highscoreData = new List <PlayerData>();
     for (int i = 0; i < ListSize; i++)
     {
         PlayerData data = PreferenceManager.ReadJsonFromPreferences <PlayerData>(PreferenceKey + i);
         if (data != null)
         {
             highscoreData.Add(data);
         }
         else
         {
             i = ListSize;
         }
     }
 }