Пример #1
0
 void Start() 
 {
   _path = new HexPathFinding(grid);
   _partyManager = new PartyManager(grid, _path, ui, AmountOfParties);
   
   grid.CreateGrid();
   // _partyManager.SpawnParties();
 }
Пример #2
0
 /// <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());
 }
Пример #3
0
    /// <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);
          }
      }
    }