コード例 #1
0
        public virtual void SetTileAspect(TileAspect _tileAspect, Vector2Int _placeVector2Int, int _loopPathIndex)
        {
            PlacedObject_WorldTile currentTileObject = _grid.GetGridObject(_placeVector2Int.x, _placeVector2Int.y).GetPlacedObject();

            List <TileAspect> newAspects = new List <TileAspect>();

            newAspects.Add(LoopPathAspect);

            Pathfinding.Instance.GetNode(_placeVector2Int.x, _placeVector2Int.y).SetIsWalkable(false);
            currentTileObject.AddTileAspects(newAspects, _loopPathIndex);
        }
コード例 #2
0
        public bool CanAddTileAspect(TileAspect _aspectToAdd)
        {
            if (placedObject.MyAspects.Contains(_aspectToAdd))
            {
                if (_aspectToAdd.IsLoopPathAspect)
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #3
0
        public virtual void SetTileAspect(TileAspect _tileAspect, Vector2Int _placeVector2Int)
        {
            PlacedObject_WorldTile currentTileObject = _grid.GetGridObject(_placeVector2Int.x, _placeVector2Int.y).GetPlacedObject();

            List <TileAspect> newAspects = new List <TileAspect>();

            newAspects.Add(LoopPathAspect);

            if (!currentTileObject.MyAspects.Contains(LoopPathAspect))
            {
                currentTileObject.SetTileAspects(newAspects);
                Pathfinding.Instance.GetNode(_placeVector2Int.x, _placeVector2Int.y).SetIsWalkable(false);
            }
        }
コード例 #4
0
        public virtual void SetTileAspect(TileAspect _tileAspect, Vector3 _placePosition)
        {
            _grid.GetXY(_placePosition, out int x, out int z);

            if (x > DB.GridWidth || z > DB.GridHeight)
            {
                return;
            }

            Vector2Int _placedObjectOrigin = new Vector2Int(x, z);

            PlacedObject_WorldTile currentTileObject = _grid.GetGridObject(_placePosition).GetPlacedObject();

            List <TileAspect> newAspects = new List <TileAspect>();

            newAspects.Add(LoopPathAspect);

            if (!currentTileObject.MyAspects.Contains(LoopPathAspect))
            {
                currentTileObject.SetTileAspects(newAspects);
                Pathfinding.Instance.GetNode(x, z).SetIsWalkable(false);
            }
        }