예제 #1
0
    public override void OnItemClick(ItemButton item)
    {
        if (!transmutationMode)
        {
            wholeScreenInputBlocker.gameObject.SetActive(true);
            itemActionMenu.gameObject.SetActive(true);

            List <ItemAction> actions = item.item.actions;
            int i = 0;
            for (; i < actions.Count && i < itemActionMenu.childCount; ++i)
            {
                ItemActionButton button = itemActionMenu.GetChild(i).GetComponent <ItemActionButton>();
                button.action = actions[i];
            }
            for (; i < actions.Count; ++i)
            {
                ItemActionButton button = Instantiate(itemActionButtonPrefab);
                button.transform.SetParent(itemActionMenu);
                button.action = actions[i];
            }
            for (; i < itemActionMenu.childCount; ++i)
            {
                itemActionMenu.GetChild(i).gameObject.SetActive(false);
            }

            StartCoroutine(RepositionMenu(itemActionMenu, item.transform as RectTransform));
        }
        else
        {
            transmutationCallback(item.item);
        }
    }
예제 #2
0
 private void Awake()
 {
     pickupable   = GetComponent <Pickupable>();
     storage      = GetComponent <ItemStorage>();
     flashlight   = GetComponent <ItemLightControl>();
     actionButton = GetComponent <ItemActionButton>();
 }
예제 #3
0
 private void Awake()
 {
     pickupable       = GetComponent <Pickupable>();
     spriteHandler    = GetComponentInChildren <SpriteHandler>();
     itemAttributesV2 = GetComponent <ItemAttributesV2>();
     actionButton     = GetComponent <ItemActionButton>();
     pickupable.RefreshUISlotImage();
 }
예제 #4
0
 private void Awake()
 {
     lightControl = GetComponent <ItemLightControl>();
     actionButton = GetComponent <ItemActionButton>();
 }
예제 #5
0
 private void Awake()
 {
     registerItem     = GetComponent <RegisterItem>();
     itemActionButton = GetComponent <ItemActionButton>();
     spriteHandler    = GetComponentInChildren <SpriteHandler>();
 }
 private void Awake()
 {
     actionButton = GetComponent <ItemActionButton>();
 }
예제 #7
0
 private void Awake()
 {
     pickupable   = GetComponent <Pickupable>();
     actionButton = GetComponent <ItemActionButton>();
 }