//move command has a stored list of the game tiles, is sent which tile the player is moving to public void move(int destination) { //if this is the first time being moved, get the list of game tiles from statemachine if (tiles == null) { m_Agent = GetComponent <NavMeshAgent> (); stateMachine = GameObject.Find("gameRun"); gameTiles = stateMachine.GetComponent <organizeGameSpaces>(); tiles = new List <GameObject> (); // Debug.Log ("loading tileset"); tiles = gameTiles.spaces; // Debug.Log (tiles); } // Debug.Log (tiles[destination].transform.position); m_Agent.destination = tiles[destination].transform.position + new Vector3(0, 0.5f, 0); }
// Use this for initialization void Start() { playerList = new List <GameObject> (); //create instance of the player dictionary, from other scripts addplayers = GetComponent <addPlayers>(); playerDict = new Dictionary <string, GameObject> (); //grab players from dicitonary and put name strings into list tiles = GetComponent <organizeGameSpaces>(); tileSet = new List <GameObject> (); tileSet = tiles.spaces; currentTurn = 0; currentRound = 0; }
public void upgradePanel() { Debug.Log(ownedColors.Count); organizeGameSpaces tiles = GetComponent <organizeGameSpaces> (); // Dictionary<Color,int> colorDict = tiles.colorList; List <GameObject> tileList = tiles.spaces; buyUpgradePanel.SetActive(true); // Dropdown field = buyUpgradePanel.transform.FindChild("selectProperty").GetComponent<Dropdown>(); List <string> options = new List <string>(); List <GameObject> propertySpaces = new List <GameObject> (); int i = 0; field.ClearOptions(); foreach (GameObject property in tileList) { realEstate real = property.GetComponent <realEstate> (); if (real != null) { if (ownedColors.Contains(real.tile.category)) { //now we need to fill a list with the properties available to buy houses for if (real.tile.houses > i) { propertySpaces.Clear(); propertySpaces.Add(property); } else if (real.tile.houses == i) { propertySpaces.Add(property); } // options.Add(property.name); // propertySpaces.Add (property); Debug.Log("name: " + property.name); //TO DO: figure out the effin drop down add values??? Maybe switch it for series of button, gawd } } } field.AddOptions(options); buyHouses(propertySpaces[Random.Range(0, propertySpaces.Count)]); // field.AddOptions (new List<Dropdown.OptionData>()); // field.RefreshShownValue (); destroyButtons(); }