Example #1
0
    void SwapActiveAction(Object sender, int index)
    {
        if (!activeActionCooldown)
        {
            if (index <= actionBarSize)
            {
                activeActionIndex = index;
                actionBars.SetActive(index);

                if (testActionBarList[index] != null)
                {
                    activeItem.data         = testActionBarList[index].data;
                    activeItem.whatIsTarget = testActionBarList[index].whatIsTarget;
                }
                else
                {
                    activeItem.data         = emptyItem.data;
                    activeItem.whatIsTarget = emptyItem.whatIsTarget;
                }

                InventoryEventManager.ActiveItemSwap(this, activeItem);
                StartCoroutine(ActionCooldown());
            }
        }
    }