Пример #1
0
 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>();
 }
Пример #2
0
 private void Start()
 {
     _selectionController = GetComponent <PlayerSelectionController>();
     _actionController    = GetComponent <ActionRelay>();
 }