private void ShowInteractables(Cell cell)
 {
     foreach (BackgroundEntity backgroundEntity in cell.BackEntities)
     {
         IInteractable interactable = backgroundEntity.GetComponent <IInteractable>();
         if (interactable != null && interactable.CanInteract)
         {
             Button button = interactPanel.AddElement(interactableButtonPrefab).GetComponent <Button>();
             button.onClick.AddListener(() => Interact(interactable));
         }
     }
 }
Exemplo n.º 2
0
        private Slot CreateSlot(ButtonPanel panel, GameObject slotPrefab)
        {
            Slot slot = panel.AddElement(slotPrefab).GetComponent <Slot>();

            OnSlotAdded?.Invoke(slot);
            return(slot);
        }
Exemplo n.º 3
0
        private void StartStage(Stage stage)
        {
            playerMoveController = stage.PlayerEntity.GetComponent <MoveController>();
            playerMoveController.OnActionDeselected += DeselectAbility;

            abilities = stage.PlayerEntity.GetComponents <Ability>();

            foreach (Ability ability in abilities)
            {
                AbilityButton abilityButton = abilityPanel.AddElement(abilityButtonPrefab).GetComponent <AbilityButton>();
                abilityButton.AttachAbility(ability);
                abilityButton.OnSelect += PressAbility;
                abilityButtons.Add(abilityButton);
            }
        }