コード例 #1
0
        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);
        }
コード例 #2
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);
        }
コード例 #3
0
 private void FinishStage(Stage stage)
 {
     playerEntity.GetComponent <IMovementController>().OnMovement -= RefreshLootInventory;
     itemController.OnItemDrop   -= RefreshLootInventory;
     itemController.OnItemPickup -= RefreshLootInventory;
     playerEntity = null;
 }
コード例 #4
0
 private void StartStage(Stage stage)
 {
     playerEntity         = stage.PlayerEntity;
     playerMoveController = playerEntity.GetComponent <MoveController>();
     stage.PlayerEntity.GetComponent <IMovementController>().OnMovement += CheckInteractiables;
     playerMoveController.OnActionSelected   += ShowUseItemButton;
     playerMoveController.OnActionDeselected += HideUseItemButton;
 }