コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        for (int i = 1; i <= numRows; i++)
        {
            for (int j = 1; j <= numCols; j++)
            {
                // create new tile
                GameObject tileIteration = Instantiate(tile);
                // get its logic object
                TileBehavior tileBehavior = tileIteration.GetComponent <TileBehavior>();
                // set row and col
                tileBehavior.setRow(i);
                tileBehavior.setCol(j);
                // set position
                setTilePosition(tileIteration, i, j);
                // put in map for reference
                GameController.positionMap.Add(new Vector2(i, j), tileBehavior);
            }
        }

        //HeroPathing pathing = new HeroPathing();
        GameController.currentPath = PathingLogic_Static.GetPath();
    }