Exemple #1
0
 private void Awake()
 {
     mainButton.onClick.AddListener(() => OnPointerClick(dummyActionTrigger));
     toggleCatalogInputAction.OnTriggered += OnPointerClick;
     BuilderInWorldUtils.ConfigureEventTrigger(catalogButtonEventTrigger, EventTriggerType.PointerEnter, (eventData) => OnPointerEnter((PointerEventData)eventData));
     BuilderInWorldUtils.ConfigureEventTrigger(catalogButtonEventTrigger, EventTriggerType.PointerExit, (eventData) => OnPointerExit());
 }
Exemple #2
0
    private void Awake()
    {
        for (int i = 0; i < shortcutsButtons.Length; i++)
        {
            int buttonIndex = i;
            shortcutsButtons[buttonIndex].onClick.AddListener(() => QuickBarObjectSelected(buttonIndex));
        }

        for (int i = 0; i < shortcutsEventTriggers.Length; i++)
        {
            int triggerIndex = i;
            BuilderInWorldUtils.ConfigureEventTrigger(shortcutsEventTriggers[triggerIndex], EventTriggerType.Drop, (eventData) =>
            {
                SetIndexToDrop(triggerIndex);
                SceneObjectDropped(eventData);
            });
        }

        quickBar1InputAction.OnTriggered += OnQuickBar1InputTriggedered;
        quickBar2InputAction.OnTriggered += OnQuickBar2InputTriggedered;
        quickBar3InputAction.OnTriggered += OnQuickBar3InputTriggedered;
        quickBar4InputAction.OnTriggered += OnQuickBar4InputTriggedered;
        quickBar5InputAction.OnTriggered += OnQuickBar5InputTriggedered;
        quickBar6InputAction.OnTriggered += OnQuickBar6InputTriggedered;
        quickBar7InputAction.OnTriggered += OnQuickBar7InputTriggedered;
        quickBar8InputAction.OnTriggered += OnQuickBar8InputTriggedered;
        quickBar9InputAction.OnTriggered += OnQuickBar9InputTriggedered;
    }
Exemple #3
0
    private void Awake()
    {
        CreateSlotToDrag();

        for (int i = 0; i < shortcutsButtons.Length; i++)
        {
            int buttonIndex = i;
            shortcutsButtons[buttonIndex].onClick.AddListener(() => QuickBarObjectSelected(buttonIndex));
        }

        for (int i = 0; i < shortcutsEventTriggers.Length; i++)
        {
            int triggerIndex = i;

            BuilderInWorldUtils.ConfigureEventTrigger(shortcutsEventTriggers[triggerIndex], EventTriggerType.BeginDrag, (eventData) =>
            {
                BeginDragSlot(triggerIndex);
            });

            BuilderInWorldUtils.ConfigureEventTrigger(shortcutsEventTriggers[triggerIndex], EventTriggerType.Drag, (eventData) =>
            {
                DragSlot(eventData, triggerIndex);
            });

            BuilderInWorldUtils.ConfigureEventTrigger(shortcutsEventTriggers[triggerIndex], EventTriggerType.EndDrag, (eventData) =>
            {
                EndDragSlot(triggerIndex);
            });

            BuilderInWorldUtils.ConfigureEventTrigger(shortcutsEventTriggers[triggerIndex], EventTriggerType.Drop, (eventData) =>
            {
                SetIndexToDrop(triggerIndex);

                if (lastIndexToBeginDrag != -1)
                {
                    SceneObjectDroppedFromQuickBar(lastIndexToBeginDrag, triggerIndex, shortcutsImgs[lastIndexToBeginDrag].image.texture);
                    CancelCurrentDragging();
                }
                else
                {
                    SceneObjectDroppedFromCatalog(eventData);
                }
            });
        }

        quickBar1InputAction.OnTriggered += OnQuickBar1InputTriggedered;
        quickBar2InputAction.OnTriggered += OnQuickBar2InputTriggedered;
        quickBar3InputAction.OnTriggered += OnQuickBar3InputTriggedered;
        quickBar4InputAction.OnTriggered += OnQuickBar4InputTriggedered;
        quickBar5InputAction.OnTriggered += OnQuickBar5InputTriggedered;
        quickBar6InputAction.OnTriggered += OnQuickBar6InputTriggedered;
        quickBar7InputAction.OnTriggered += OnQuickBar7InputTriggedered;
        quickBar8InputAction.OnTriggered += OnQuickBar8InputTriggedered;
        quickBar9InputAction.OnTriggered += OnQuickBar9InputTriggedered;
    }
Exemple #4
0
 private void Awake()
 {
     mainButton.onClick.AddListener(OnPointerClick);
     BuilderInWorldUtils.ConfigureEventTrigger(publishButtonEventTrigger, EventTriggerType.PointerEnter, (eventData) => OnPointerEnter((PointerEventData)eventData));
     BuilderInWorldUtils.ConfigureEventTrigger(publishButtonEventTrigger, EventTriggerType.PointerExit, (eventData) => OnPointerExit());
 }
Exemple #5
0
 private void Awake()
 {
     BuilderInWorldUtils.ConfigureEventTrigger(dragAndDropEventTrigger, EventTriggerType.Drop, (eventData) => Drop());
 }