Beispiel #1
0
 public static BDTeam Deserialize(string teamString)
 {
     // Backward compatibility
     if (string.IsNullOrEmpty(teamString) || teamString == "False")
     {
         return(BDTeam.Get("A"));
     }
     else if (teamString == "True")
     {
         return(BDTeam.Get("B"));
     }
     try
     {
         BDTeam team = UnityEngine.JsonUtility.FromJson <BDTeam>(Misc.JsonDecompat(teamString));
         if (!BDArmorySetup.Instance.Teams.ContainsKey(team.Name))
         {
             BDArmorySetup.Instance.Teams.Add(team.Name, team);
         }
         return(BDArmorySetup.Instance.Teams[team.Name]);
     }
     catch
     {
         return(BDTeam.Get("A"));
     }
 }
Beispiel #2
0
 public static BDTeam Deserialize(string teamString)
 {
     // Backward compatibility
     if (string.IsNullOrEmpty(teamString) || teamString == "False")
     {
         return(BDTeam.Get("A"));
     }
     else if (teamString == "True")
     {
         return(BDTeam.Get("B"));
     }
     try
     {
         BDTeam team = UnityEngine.JsonUtility.FromJson <BDTeam>(Misc.JsonDecompat(teamString));
         if (!BDArmorySetup.Instance.Teams.ContainsKey(team.Name))
         {
             BDArmorySetup.Instance.Teams.Add(team.Name, team);
         }
         return(BDArmorySetup.Instance.Teams[team.Name]);
     }
     catch (Exception e)
     {
         Debug.LogWarning("[BDArmory.BDTeam]: Exception thrown in Deserialize: " + e.Message + "\n" + e.StackTrace);
         return(BDTeam.Get("A"));
     }
 }