Пример #1
0
        public void RefreshButtons()
        {
            var unit = unitSelection.GetSelectedUnit();

            if (unit != null)
            {
                if (!unit.WasMoved())
                {
                    if ((int)unit.GetUnitTeam() == (int)playerControler.GetCurrentPlayer())
                    {
                        healBT.interactable = true;
                    }
                    if (CellSelection.GetInstance().GetSelectedCell().type == Cell.CellType.LightPortal && unit.GetUnitTeam() == Unit.Team.Dark)
                    {
                        captureBT.interactable = true;
                    }
                    if (CellSelection.GetInstance().GetSelectedCell().type == Cell.CellType.DarkPortal && unit.GetUnitTeam() == Unit.Team.Light)
                    {
                        captureBT.interactable = true;
                    }
                    if (CellSelection.GetInstance().GetSelectedCell().type == Cell.CellType.Portal)
                    {
                        captureBT.interactable = true;
                    }
                    return;
                }
            }
            healBT.interactable    = false;
            captureBT.interactable = false;
        }
Пример #2
0
 private void Awake()
 {
     cellSelection = CellSelection.GetInstance();
     unitsList     = UnitsList.GetInstance();
     unitSelection = UnitSelection.GetInstance();
 }