コード例 #1
0
ファイル: PathFindManager.cs プロジェクト: tianz0607/Tools
        void Awake()
        {
            neighbors = new List <GridItem>();
            GridItems = new GridItem[Rows * Cols];
            var parent = transform.Find("Grids");

            for (int row = 0; row < Rows; row++)
            {
                for (int col = 0; col < Cols; col++)
                {
                    GridItem item = new GridItem(row, col, GridType.Normal);
                    item.InitGameObject(parent, GridPrefab, itemSize);

                    int index = GetTileIndex(row, col);
                    GridItems[index] = item;
                }
            }
            SetStart(0, 0);
            SetEnd(9, 9);
            SetExpensive(1, 1);
            SetExpensive(1, 2);
            SetExpensive(2, 1);

            ResetGrids();
        }
コード例 #2
0
ファイル: PathFindManager.cs プロジェクト: letian0111/Tools
        void Awake()
        {
            neighbors = new List <GridItem>();
            GridItems = new GridItem[Rows * Cols];
            var parent = transform.Find("Grids");

            for (int row = 0; row < Rows; row++)
            {
                for (int col = 0; col < Cols; col++)
                {
                    GridItem item = new GridItem(row, col, GridType.Normal);
                    item.InitGameObject(parent, GridPrefab, itemSize);

                    int index = GetTileIndex(row, col);
                    GridItems[index] = item;
                }
            }

            ClearGrids();
        }