Ejemplo n.º 1
0
        protected override void AddRoadNeighbor(AbstractTile tile)
        {
            base.AddRoadNeighbor(tile);

            bool shouldRotate = CachedTransform.DirectionIsFacingTransform(Direction.Forward, tile.CachedTransform) ||
                                CachedTransform.DirectionIsFacingTransform(Direction.Right, tile.CachedTransform);

            CachedTransform.DirectionLookAtTransform(roadDirection, tile.CachedTransform);

            if ((GridPosition.x + GridPosition.y & 1) == 0)
            {
                shouldRotate ^= true;
            }

            if (shouldRotate)
            {
                CachedTransform.Rotate(CachedTransform.up, 180.0f);
            }
        }