void updateProductionFlag() { foreach (var res in state.InputRecourcesLocal) { if (res.Value < abParams.InputRecources[res.Key]) { ProductionFlag = false; return; } } if (UtilityDebug.ActivebuildingLog) { Debug.Log($"[AB_Input] {state.Building.BuildingName} разрешил производство " + $"[{ Time.deltaTime}]", state.Building.gameObject); } ProductionFlag = true; ProductionAvaliable.Invoke(); }
void updateProductionFlag() { foreach (var res in state.OutputRecourcesLocal) { if (res.Value + abParams.OutputRecources[res.Key] > abParams.OutputRecourceCapacity[res.Key]) { ProductionFlag = false; if (UtilityDebug.ActivebuildingLog) { Debug.Log($"[AB_Output] {state.Building.BuildingName} обновил production flag {ProductionFlag}" + $" [{ Time.deltaTime}]", state.Building.gameObject); } return; } } ProductionFlag = true; if (UtilityDebug.ActivebuildingLog) { Debug.Log($"[AB_Output] {state.Building.BuildingName} обновил production flag {ProductionFlag}" + $" [{ Time.deltaTime}]", state.Building.gameObject); } ProductionAvaliable.Invoke(); }