public void SpawnBox(BoxTile tile) { BoxCharacter box = Instantiate(boxPrefab, boxParent).GetComponent <BoxCharacter>(); box.Spawn(mapContainer, tile); boxes.Add(box); }
public bool OnPlayerPush(Direction dir, int x, int y) { BoxCharacter box = GetBox(x, y); if (!box) { return(false); } box.MoveForward(dir); return(true); }