コード例 #1
0
    //*** rework the add item to list
    // make a proper add item to list with sort and filter in mind

    private void Update()
    {
        if (Input.GetMouseButtonDown(1) && invenManager.selectedButton != null) //right click to return item to list if item is from list
        {
            invenManager.RefrechColor(false);
            invenManager.selectedButton.GetComponent <CanvasGroup>().alpha = 1f;
            invenManager.selectedButton = null;
            itemEquipPool.ReturnObject(ItemScript.selectedItem);
            ItemScript.ResetSelectedItem();
        }
    }
コード例 #2
0
 public void BackToMenu()
 {
     for (int i = 0; i < pair.Count; ++i)
     {
         entityObject.ReturnObject(pair[i].Value);
     }
     SceneManager.LoadScene("Menu");
 }
コード例 #3
0
    private void Update()
    {
        if (Input.GetMouseButtonDown(0) && Input.mousePosition.x > GetComponent <Transform>().position.x) // drop item back
        {
            if (invenManger.selectedButton == null && ItemScript.selectedItem != null)                    //dropping back from ivenGrid
            {
                itemList.Add(ItemScript.selectedItem.GetComponent <ItemScript>().item);
                AddButton(ItemScript.selectedItem.GetComponent <ItemScript>().item);// shorten later
                itemEquipPool.ReturnObject(ItemScript.selectedItem);
                ItemScript.ResetSelectedItem();
            }
        }

        if (Input.GetMouseButtonDown(1) && invenManger.selectedButton != null) //delesect selected item and button  by right-click
        {
            invenManger.RefrechColor(false);                                   // not refresh color to blue when mouse is non top of occupied slot after putting back itemEquip
            invenManger.selectedButton.GetComponent <CanvasGroup>().alpha = 1f;
            invenManger.selectedButton = null;
            itemEquipPool.ReturnObject(ItemScript.selectedItem);
            ItemScript.ResetSelectedItem();
        }
    }
コード例 #4
0
    public void OnDeselect(BaseEventData eventData)
    {
        string lastInput = EntityScrollList.SearchField.text;

        if (!elementSet.Contains(lastInput) && lastInput != "")
        {
            if (objList.GetSize() == HISTORY)
            {
                GameObject retVal = objList.PollLast();
                elementSet.Remove(lastAdded);
                objectPool.ReturnObject(retVal);
            }
            elementSet.Add(lastInput);
            lastAdded = lastInput;
            GameObject obj = objectPool.GetObject();
            obj.transform.SetParent(contentPanel);
            SearchedElementInfo element = obj.GetComponent <SearchedElementInfo>();
            element.Setup(lastInput);
            objList.OfferFirst(obj);
        }
    }
コード例 #5
0
 public void RemoveButton(GameObject buttonObj)
 {
     buttonObj.GetComponent <CanvasGroup>().alpha = 1f;
     currentButtonList.Remove(buttonObj);
     itemButtonPool.ReturnObject(buttonObj);
 }
コード例 #6
0
 public void RemoveButton(GameObject buttonObj)
 {
     buttonObj.GetComponent <CanvasGroup>().alpha = 1f;
     itemButtonPool.ReturnObject(buttonObj);
     RevomeItemFromList(buttonObj.GetComponent <ItemButtonScript>().item);
 }