//----------------------------------------------------------------------------------- public void Init(Data.GameData gameData) { m_gameData = gameData; m_stats = new StatsProviderLocal(); m_stats.Load(); if (m_stats.GetConfig().m_strPlayerName.Length == 0) { m_stats.GetConfig().m_strPlayerName = "Player_" + UnityEngine.Random.Range(1000, 9000000).ToString(); m_stats.Save(); } m_adsMan = new Ads.AdsManager(); m_adsMan.Init(); m_netMan = new Net.NetManager(); m_netMan.Init(); m_ui = new UserInterface(); m_ui.Init(); m_ui.SwitchToState(new GameGUI.States.MainMenuParams()); }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }