public void Close() { if (!gameObject.activeSelf) { return; } gameObject.SetActive(false); currentState.StaticRecourcesChanged -= updateInfo; GlobalRecources.RecourcesChanged -= updateInfo; currentState = null; }
public void Show(PB_ProductionCycle state) { if (currentState == null) { currentState = state; gameObject.SetActive(true); currentState.StaticRecourcesChanged += updateInfo; GlobalRecources.RecourcesChanged += updateInfo; updateInfo(); } else { Close(); Show(state); } }