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));
         }
     }
 }
Beispiel #2
0
        private Slot CreateSlot(ButtonPanel panel, GameObject slotPrefab)
        {
            Slot slot = panel.AddElement(slotPrefab).GetComponent <Slot>();

            OnSlotAdded?.Invoke(slot);
            return(slot);
        }
Beispiel #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);
            }
        }