Esempio n. 1
0
    public override bool Action(GamePiece other)
    {
        PlayerPice pp = other as PlayerPice;

        pp.iM.AddCart(token);

        Lives = 0;

        return(true);
    }
Esempio n. 2
0
    private void SpawnPlayer()
    {
        UpdateEmptyTiles();
        int r = Random.Range(0, freeTiles.Count);

        int x = freeTiles[r].x;
        int y = freeTiles[r].y;

        if (playerId == null)
        {
            playerId = Instantiate(Player);
            playerId.transform.SetParent(transform, false);
            PlayerPice pp = playerId.GetComponent <PlayerPice>();
            pp.iM = inventory;
        }
        playerId.transform.position = allTiles[x, y].Pos;

        allTiles[x, y].ocupy = true;
        allTiles[x, y].Id    = playerId;
        allTiles[x, y].tT    = TileTipe.Player;

        Pieces.Add(allTiles[x, y].Id.GetComponent <GamePiece>());
    }