public void UnloadStatEntry(UI_StatEntry statEntry) { UI_StatEntry chosenEntry = statEntry; GameManager.MasterManager._StatEntries.Remove(statEntry); Destroy(chosenEntry.gameObject); }
//TODO: Load overhaul, e.g. _matchEntries list, creating dictionary and load into GameManager Awake or Start public void LoadStatistics() { GameManager.MasterManager._RunningSessionStats.Matches = new Dictionary <int, string>(); GameManager.MasterManager._RunningSessionStats.LoadStats(); if (GameManager.MasterManager._RunningSessionStats.Matches != null && GameManager.MasterManager._RunningSessionStats.Matches.Count > 0) { foreach (KeyValuePair <int, string> matchPath in GameManager.MasterManager._RunningSessionStats.Matches) { Match m = Match.LoadMatch(matchPath.Value); if (m != null) { UI_StatEntry matchStats = Instantiate(GameManager.MasterManager.UIManager._matchLinePrefab, GameManager.MasterManager.UIManager._MatchList.position, Quaternion.identity, GameManager.MasterManager.UIManager._MatchList); matchStats.UpdateEntry(m); GameManager.MasterManager.NetworkManager._matchEntries.Add(m, matchStats.gameObject); } } } }
public UI_StatEntry LoadStatEntry() { UI_StatEntry statEntry = Instantiate(GameManager.MasterManager.UIManager._matchLinePrefab, GameManager.MasterManager.UIManager._MatchList.transform.position, Quaternion.identity); return(statEntry); }