public void RemoveResearch(Research r) { print("Remove Research"); foreach (dfButton button in researchButtonPanel.GetComponentsInChildren <dfButton>()) { if (button.Text == r.ButtonText(state.population, state.iq)) { researchButtonPanel.RemoveControl(button); Destroy(button.gameObject); break; } } }
public void AddResearch(Research r) { if (state == null) { state = GameState.Instance; } dfButton button = (dfButton)Instantiate(prefabResearchButton); ResearchContainer container = button.GetComponent <ResearchContainer>(); container.r = r; container.state = state; button.Text = r.ButtonText(state.population, state.iq); button.ZOrder = -1; researchBackButton.ZOrder = 0; researchButtonPanel.AddControl(button); }
public void RemoveResearch(Research r) { print("Remove Research"); foreach (dfButton button in researchButtonPanel.GetComponentsInChildren<dfButton>()) { if (button.Text == r.ButtonText(state.population,state.iq)) { researchButtonPanel.RemoveControl(button); Destroy(button.gameObject); break; } } }
public void AddResearch(Research r) { if (state == null) state = GameState.Instance; dfButton button = (dfButton)Instantiate(prefabResearchButton); ResearchContainer container = button.GetComponent<ResearchContainer>(); container.r = r; container.state = state; button.Text = r.ButtonText(state.population,state.iq); button.ZOrder = -1; researchBackButton.ZOrder = 0; researchButtonPanel.AddControl(button); }