Example #1
0
        public bool FindPath(Vector3 startPos, Vector3 targetPos, out List <Tile> path)
        {
            Tile startTile  = MapUtility.TileFromWorldPosition(startPos);
            Tile finishTile = MapUtility.TileFromWorldPosition(targetPos);

            return(this.FindPath_Internal(startTile, finishTile, out path));
        }
 protected bool OnInput()
 {
     if (this.controller.RightClick() == true)
     {
         var pos  = CursorToWorldPos();
         var tile = MapUtility.TileFromWorldPosition(pos);
         tile.ToggleBlock(tile.traversable);
         return(true);
     }
     else if (this.controller.LeftClick() == true)
     {
         var pos = CursorToWorldPos();
         this.player.currentHero.movement.SetDestination(MapUtility.TileFromWorldPosition(pos));
         return(true);
     }
     else if (this.controller.Space() == true)
     {
         this.player.currentHero.currentTile.interaction.Invoke(this.player.currentHero.hero);
     }
     else if (this.controller.Validate() == true)
     {
         this.gm.currentMap.ShowTiles(new TilePositon(x, y), 5);
     }
     return(false);
 }