public LootBoxModel() { if (Instance != null) { Debug.LogWarning("Replacing the current model!"); } Instance = this; List <Units> unitTypes = Enum.GetValues(typeof(Units)).Cast <Units>().ToList(); Resources = new Dictionary <Units, Resource>(); for (int i = 0; i < unitTypes.Count; i++) { Units type = unitTypes[i]; Resources.Add(type, new Resource(type, 0)); } UpgradeManager = new UpgradeManager(this); UpgradeManager.IsActive = true; Time = new TimeModel(this); Life = new LifeModel(this); Life.IsActive = true; Job = new JobModel(this); Job.IsActive = false; MacGuffinQuest = new MacGuffinQuest(this); MacGuffinQuest.IsActive = false; Influencer = new InfluencerModel(this); Influencer.IsActive = false; Studio = new StudioModel(this); Studio.IsActive = false; Public = new PublicModel(this); Public.IsActive = false; SetInitialState(); #if DEBUG if (UnlockAllViews) { Life.IsActive = true; UpgradeManager.IsActive = true; Job.IsActive = true; MacGuffinQuest.IsActive = true; Influencer.IsActive = true; Studio.IsActive = true; Public.IsActive = true; } #endif }
public void Tick() { Time.Tick(); Life.Tick(); Job.Tick(); MacGuffinQuest.Tick(); Influencer.Tick(); Studio.Tick(); Public.Tick(); UpgradeManager.Tick(); if (!allMonetizedSequenceStarted && UpgradeManager.IsPurchased(Upgrade.EUpgradeType.LaunchMeshNetwork) && (ActivePlayers == Resources[Units.ActivePlayer].MaxValue)) { allMonetizedSequenceStarted = true; Game.Instance.OnAllEarthMonetized(); } TickCount++; }