Пример #1
0
        private void SetUpUnitEntityVisual(PlayerUnitEntityController ctrl)
        {
            SpriteRenderer renderer = ctrl.GetComponent <SpriteRenderer>();

            unitSprite = renderer.sprite;
            unitColor  = renderer.color;
        }
Пример #2
0
        public void SetSelectedUnit(PlayerUnitEntityController ctrl)
        {
            UnitEntity unit = ctrl.Unit;

            RemoveCallbacks();
            selectedUnit = unit;

            SetUpUnitEntityVisual(ctrl);
            AddCallbacks();

            // Update graphics
            UpdateUnitPanel();
            UpdateActionButtons();
        }
Пример #3
0
 public void SetSelectedUnit(PlayerUnitEntityController newSelectedUnit)
 {
     if (newSelectedUnit != null)
     {
         if (SelectedUnit != null)
         {
             SelectedUnit.Deselect();
             graphics.OnDeselect();
         }
         SelectedUnit = newSelectedUnit;
         graphics.OnSelect(newSelectedUnit);
     }
     else
     {
         SelectedUnit = null;
         graphics.OnDeselect();
     }
 }
Пример #4
0
 public void OnSelect(PlayerUnitEntityController unit)
 {
     SetSelectedUnit(unit);
     ShowUnitPanel();
 }