public void Close() { if (!gameObject.activeSelf) { return; } gameObject.SetActive(false); currentState.OutputAdded -= updateInfo; currentState.OutputSubstracted -= updateInfo; currentState.Ab_Work.ProgressChanged -= updateInfo; currentState.InputSubstracted -= updateInfo; currentState.InputAdded -= updateInfo; currentState.StaticRecourcesProvided -= updateInfo; currentState = null; }
public void Show(AB_State_ProductionCycle state) { if (currentState == null) { currentState = state; startStopBTN.Initialize(state.Building); gameObject.SetActive(true); state.OutputAdded += updateInfo; state.OutputSubstracted += updateInfo; state.Ab_Work.ProgressChanged += updateInfo; state.InputSubstracted += updateInfo; state.InputAdded += updateInfo; state.StaticRecourcesProvided += updateInfo; updateInfo(); } else { Close(); Show(state); } }
public AB_Output(AB_State_ProductionCycle state) { this.state = state; abParams = state.Building.AbParams; localStorageAdd += onLocalStorageAdd; }
public AB_Input(AB_State_ProductionCycle state) { this.state = state; abParams = state.Building.AbParams; }
public AB_Work(AB_State_ProductionCycle state) { this.state = state; abParams = state.Building.AbParams; ticksNeed = abParams.TicksToProduce; }