private void StartStage(Stage stage) { playerEntity = stage.PlayerEntity; playerMoveController = playerEntity.GetComponent <PlayerMoveController>(); playerMovement = playerEntity.GetComponent <IMovementController>(); playerMovement.OnMovement += RefreshLootInventory; itemController.OnItemDrop += RefreshLootInventory; itemController.OnItemPickup += RefreshLootInventory; RefreshInventory(playerEntity.Cell); }
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); }
private void FinishStage(Stage stage) { playerEntity.GetComponent <IMovementController>().OnMovement -= RefreshLootInventory; itemController.OnItemDrop -= RefreshLootInventory; itemController.OnItemPickup -= RefreshLootInventory; playerEntity = null; }
private void StartStage(Stage stage) { playerEntity = stage.PlayerEntity; playerMoveController = playerEntity.GetComponent <MoveController>(); stage.PlayerEntity.GetComponent <IMovementController>().OnMovement += CheckInteractiables; playerMoveController.OnActionSelected += ShowUseItemButton; playerMoveController.OnActionDeselected += HideUseItemButton; }