示例#1
0
    void Start()
    {
        boardText.text = "";

        for (int i = 0; i < tileListSize; i++)
        {
            tileList.Add(new Tile());
            tileList[i].gameObject = Instantiate(tilePrefab, tileHolderGameObject);
            tileList[i].myIndex    = i;
            tileList[i].isChecked  = false;
            tileList[i].TileType   = Random.Range(0, ingredients.Length);
            tileList[i].gameObject.transform.GetChild(0).GetComponent <Image>().sprite = ingredients[tileList[i].TileType].sprite;
        }
        gameLogicManager.DestroyedConstructor(ingredients.Length);

        if (CheckForDeadend())
        {
            ShuffleTiles();
        }
    }