private void BuildSpawner(UnitComponent type) { inputDisabled = true; GetComponentInParent <Building>().Build(type); foreach (Unit unit in unitHolder.hashUnits) { if (!unit.TryGetComponent(out Warrior warrior)) { unitHolder.RemoveUnit(unit); unit.gameObject.SetActive(false); break; } } }
public Coroutine RemoveUnit(int laneIndex, int sideIndex, int positionIndex) { UnitHolder holder = unitManagers[sideIndex].unitHolders[laneIndex, positionIndex]; return(holder.RemoveUnit()); }