Esempio n. 1
0
    public void SpawnBox(BoxTile tile)
    {
        BoxCharacter box = Instantiate(boxPrefab, boxParent).GetComponent <BoxCharacter>();

        box.Spawn(mapContainer, tile);
        boxes.Add(box);
    }
Esempio n. 2
0
    public bool OnPlayerPush(Direction dir, int x, int y)
    {
        BoxCharacter box = GetBox(x, y);

        if (!box)
        {
            return(false);
        }

        box.MoveForward(dir);
        return(true);
    }