private void StartCooldown(SlotCooldownStateNode slot, ItemButtonComponent item)
        {
            float timeInSec = (((float)slot.inventoryCooldownState.CooldownTime) / 1000f) - (Date.Now.UnityTime - slot.inventoryCooldownState.CooldownStartTime.UnityTime);

            if (!item.isRage)
            {
                item.StartCooldown(timeInSec, slot.Entity.HasComponent <InventoryEnabledStateComponent>());
            }
            else
            {
                item.StartRageCooldown(timeInSec, slot.Entity.HasComponent <InventoryEnabledStateComponent>());
            }
        }
Ejemplo n.º 2
0
        public string GetKeyBindForItem(ItemButtonComponent item)
        {
            string[]  strArray = new string[] { InventoryAction.INVENTORY_SLOT1, InventoryAction.INVENTORY_SLOT2, InventoryAction.INVENTORY_SLOT3, InventoryAction.INVENTORY_SLOT4, InventoryAction.INVENTORY_GOLDBOX };
            Transform parent   = item.transform.parent.parent;

            for (int i = 0; i < strArray.Length; i++)
            {
                Transform child = parent.GetChild(i);
                if (item.transform.parent == child)
                {
                    InputAction action = InputManager.GetAction(new InputActionId("Tanks.Battle.ClientCore.Impl.InventoryAction", strArray[i]), new InputActionContextId("Tanks.Battle.ClientCore.Impl.BasicContexts"));
                    return(((action == null) || (action.keys.Length == 0)) ? string.Empty : KeyboardSettingsUtil.KeyCodeToString(action.keys[0]));
                }
            }
            return(string.Empty);
        }