Ejemplo n.º 1
0
        private void SetUpUnitEntityVisual(PlayerUnitEntityController ctrl)
        {
            SpriteRenderer renderer = ctrl.GetComponent <SpriteRenderer>();

            unitSprite = renderer.sprite;
            unitColor  = renderer.color;
        }
Ejemplo n.º 2
0
        public void SetSelectedUnit(PlayerUnitEntityController ctrl)
        {
            UnitEntity unit = ctrl.Unit;

            RemoveCallbacks();
            selectedUnit = unit;

            SetUpUnitEntityVisual(ctrl);
            AddCallbacks();

            // Update graphics
            UpdateUnitPanel();
            UpdateActionButtons();
        }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 4
0
 public void OnSelect(PlayerUnitEntityController unit)
 {
     SetSelectedUnit(unit);
     ShowUnitPanel();
 }