public static void AddTaxControls() { if (isTaxControlsNotCreated()) { UITabContainer economyContainer = ToolsModifierControl.economyPanel.component.Find <UITabContainer>("EconomyContainer"); if (economyContainer != null) { UIPanel taxesPanel = economyContainer.Find <UIPanel>("Taxes"); if (taxesPanel != null) { UITaxSetPanel taxSetPanel1 = taxesPanel.AddUIComponent <UITaxSetPanel>(); taxSetPanel1.name = "taxSetPanel1"; taxSetPanel1.position = new Vector3(10, -40); taxSetPanel1.TaxValuesStorageIndex = 0; UITaxSetPanel taxSetPanel2 = taxesPanel.AddUIComponent <UITaxSetPanel>(); taxSetPanel2.name = "taxSetPanel2"; taxSetPanel2.position = new Vector3(10, -140); taxSetPanel2.TaxValuesStorageIndex = 1; UITaxSetPanel taxSetPanel3 = taxesPanel.AddUIComponent <UITaxSetPanel>(); taxSetPanel3.name = "taxSetPanel3"; taxSetPanel3.position = new Vector3(10, -240); taxSetPanel3.TaxValuesStorageIndex = 2; } } } }
public override void OnLevelLoaded(LoadMode mode) { if (mode == LoadMode.NewGame || mode == LoadMode.LoadGame || mode == LoadMode.NewGameFromScenario) { UITaxSetPanel.AddTaxControls(); Singleton <TaxMultiplierManager> .instance.Init(); } }