Exemplo n.º 1
0
    void MoveTextTile()
    {
        while (remainingMovement > 0)
        {
            if (playerPath == null)
            {
                return;
            }


            transform.position = mapScript.TileCoordToWorldCoord(posX, posY);

            remainingMovement -= mapScript.CostToEnterTile(playerPath[0].x, playerPath[0].y);

            posX = playerPath[1].x;
            posY = playerPath[1].y;

            playerPath.RemoveAt(0);

            if (playerPath.Count == 1)
            {
                playerPath = null;
            }
        }
    }
Exemplo n.º 2
0
 void Update()
 {
     if (health <= 0)
     {
         player.GetComponent <Player>().target = null;
         Destroy(this.gameObject);
         map.assetPresent[x, y]       = false;
         map.graph[x, y].movementCost = map.CostToEnterTile(x, y);
     }
 }