/// <summary>
        /// Get info about last session
        /// </summary>
        /// <returns>info about last session</returns>
        private string getLastObjectInformation()
        {
            SessionResult result       = Menu.SessionList.Sessions[Menu.SessionList.Sessions.Count - 1];
            string        stringResult = String.Format("Player name: {0}\nCoins: {1}\nTime int labyrinth: {2}\nGame Started: {3}\nDeath Cause: {4}",
                                                       result.PlayerName,
                                                       result.Coins,
                                                       result.SpentTime,
                                                       result.TimeCreated.ToString("G"),
                                                       result.DeathCause);

            return(stringResult);
        }
Example #2
0
 /// <summary>
 /// Save Results and start new scene
 /// </summary>
 public void SaveResults(string nameDeath)
 {
     try
     {
         Debug.Log("TimeCreate " + Player.TimeCreate);
         Debug.Log("Spend " + (DateTime.Now - Player.TimeCreate).ToString());
         Debug.Log("Name " + Player.Name);
         Debug.Log("Coins " + Player.Coins);
         Debug.Log("NameDeath " + nameDeath);
         SessionResult sessionResult = new SessionResult(Player.TimeCreate, (DateTime.Now - Player.TimeCreate), Player.Name, Player.Coins, nameDeath);
         Menu.SessionList.Sessions.Add(sessionResult);
         Menu.SessionList.Save();
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
     SceneManager.LoadScene("Result");
 }