void Start() { _path = new HexPathFinding(grid); _partyManager = new PartyManager(grid, _path, ui, AmountOfParties); grid.CreateGrid(); // _partyManager.SpawnParties(); }
/// <summary> /// Constructor of the party manager. /// </summary> /// <param name="grid">Reference to the HexGrid class.</param> /// <param name="amountOfParties">How many parties should we make.</param> public PartyManager(HexGrid grid, HexPathFinding path, UIManager ui, byte amountOfParties) { AmountOfParties = amountOfParties; _grid = grid; _path = path; _ui = ui; CreateParties(); _ui.SetTurnIndicator(parties[_currentParty].GetPartyColor()); }
/// <summary> /// Standard update method from Unity MonoBehaviours /// </summary> void Update() { if (Input.GetKeyDown (KeyCode.P)) { HexPathFinding hPath = new HexPathFinding(this); // List<CubeCoordinate> moves = hPath.MovesInRange(GetMousePosition().ToCube(), 3); List<CubeCoordinate> moves = hPath.GetPath(new CubeCoordinate(0,0,0), GetMousePosition().ToCube()); Color color = new Color(Random.Range(0, 1f), Random.Range(0, 1f), Random.Range(0,1f)); if (moves != null) foreach (CubeCoordinate c in moves) { Hexagon h = GetHexagonAtPosition(c.ToAxial()); h.SetIndicatorColor(color); } } }