Esempio n. 1
0
        private void SpawnItem(GameObject chestPrefab, Cell cell, ItemController itemController)
        {
            CellEntity chestEntity = Instantiate(chestPrefab, cell.Transform).GetComponent <CellEntity>();

            chestEntity.Attach(cell);
            chestEntity.GetComponent <ChestInteractable>()?.Initialize(itemController);
        }
Esempio n. 2
0
        public CellEntity GeneratePlayer(Cell cell)
        {
            CellEntity player = Instantiate(playerPrefab).GetComponent <CellEntity>();

            player.Attach(cell);
            player.transform.position = cell.Transform.position;
            return(player);
        }
Esempio n. 3
0
        public CellEntity GenerateEnemy(GameObject prefab, Cell cell)
        {
            CellEntity enemy = Instantiate(prefab).GetComponent <CellEntity>();

            enemy.Attach(cell);
            enemy.transform.position = cell.Transform.position;
            return(enemy);
        }
Esempio n. 4
0
 public void Drop(Cell cell)
 {
     CellEntity.Attach(cell);
     ParentEntity = null;
 }