private void FixedUpdate() { if (UnitDispatchNumber < onceMax && player.IsEnoughForUnit(unit, GameResourceType.Gold) && !dispatchManagerUI.IsInDispatching && player.CountUnits(unit.unitType) + UnitDispatchNumber < unit.playerOwnMax) { _dispatchButton.interactable = true; } else { _dispatchButton.interactable = false; } }