Exemple #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>();
 }
Exemple #2
0
 public void SetPlayer(PlayerInformation player)
 {
     if (_player == null)
     {
         _player = player;
         _selectionController = FindObjectsOfType <SelectionController>()
                                .Where(s => s.Player == _player)
                                .FirstOrDefault();
         if (!_selectionController)
         {
             return;
         }
         _selectionController.SelectableBuildings.Add(gameObject);
     }
 }
Exemple #3
0
 private void Start()
 {
     Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
     FindObjectOfType <UnitRaycaster>().UpdateActiveLayer += SetMouseCursor;
     _selectionController = GetComponentInChildren <SelectionController>();
 }