Пример #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);
        }
Пример #2
0
        public CellEntity GeneratePlayer(Cell cell)
        {
            CellEntity player = Instantiate(playerPrefab).GetComponent <CellEntity>();

            player.Attach(cell);
            player.transform.position = cell.Transform.position;
            return(player);
        }
Пример #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);
        }
Пример #4
0
 public void Drop(Cell cell)
 {
     CellEntity.Attach(cell);
     ParentEntity = null;
 }