private void SetupUnit() { _selectionController = FindObjectsOfType <SelectionController>() .Where(s => s.Player == PlayerOwner) .FirstOrDefault(); if (!_selectionController) { return; } _selectionController.SelectableUnits.Add(gameObject); _actionController = _selectionController.GetComponent <ActionRelay>(); _unitActionController = GetComponent <UnitActionController>(); _selectionProjector = GetComponentInChildren <Projector>(); }
private void Start() { _selectionController = GetComponent <PlayerSelectionController>(); _actionController = GetComponent <ActionRelay>(); }