示例#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
 public static CellSelection GetInstance()
 {
     if (instance == null)
     {
         instance = new CellSelection();
     }
     return(instance);
 }
示例#3
0
 private void Awake()
 {
     cellSelection = CellSelection.GetInstance();
     unitsList     = UnitsList.GetInstance();
     unitSelection = UnitSelection.GetInstance();
 }