Exemplo n.º 1
0
 public void copyData(ItemInventoryBase item)
 {
     this.name           = item.name;
     this.gl             = item.gl;
     this.reagent        = item.reagent;
     this.stackable      = item.stackable;
     this.itemType       = item.itemType;
     this.itemBeingHeld  = item.itemBeingHeld;
     this.index          = item.index;
     this.underText      = item.underText;
     this.physicalObject = item.physicalObject;
 }
    public void OpenOptionDialog(ItemToInventory item)
    {
        if (CursorManager.GetCurrentState() != MouseState.ms_interacting)
        {
            CursorManager.SetMouseState(MouseState.ms_interacting);
            if (item is Glassware)
            {
                if (gameObject.GetComponentInParent <WorkBench> ().positionGlassEquipament != null &&
                    gameObject.GetComponentInParent <WorkBench> ().positionGlassEquipament.childCount != 0 &&
                    item.gameObject.Equals(gameObject.GetComponentInParent <WorkBench> ().positionGlassEquipament.GetChild(0).gameObject))
                {
                    List <int> ids = new List <int> ();
                    ids.Add(0);
                    ids.Add(2);
                    optionDialogGlass.GetComponent <OptionDialogBehaviour> ().changeIDs(ids);
                }
                else
                {
                    List <int> ids = new List <int> ();
                    ids.Add(0);
                    ids.Add(1);
                    optionDialogGlass.GetComponent <OptionDialogBehaviour> ().changeIDs(ids);
                }
                optionDialogGlass.SetActive(true);
                optionDialogGlass.GetComponent <OptionDialogBehaviour> ().setCurrentItem(item);
                if (item.GetComponent <Glassware>().content == null)                 //Enabling or disabling the edit label button. TODO: Refactor later
                {
                    optionDialogGlass.GetComponent <OptionDialogBehaviour> ().editLabelButton.enabled     = false;
                    optionDialogGlass.GetComponent <OptionDialogBehaviour> ().editLabelButton.image.color = Color.grey;
                }
                else
                {
                    optionDialogGlass.GetComponent <OptionDialogBehaviour> ().editLabelButton.enabled     = true;
                    optionDialogGlass.GetComponent <OptionDialogBehaviour> ().editLabelButton.image.color = Color.white;
                }
                glasswareLabelEditor.GetComponent <OptionDialogBehaviour> ().setCurrentItem(item);
                return;
            }

            if (item is ReagentPot)
            {
                optionDialogReagent.SetActive(true);
                optionDialogReagent.GetComponent <OptionDialogBehaviour> ().setCurrentItem(item);

                return;
            }
        }
    }
Exemplo n.º 3
0
 public void HoldItem(ItemToInventory item)
 {
     itemBeingHeld = item;
 }
 public void setCurrentItem(ItemToInventory i)
 {
     this.item = i;
 }