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