Esempio n. 1
0
 public void Cancel()
 {
     ItemToUnstack      = null;
     InventoryBehaviour = null;
     scrollBar.onValueChanged.RemoveListener(OnScrollbarValueChanged);
     gameObject.SetActive(false);
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     stage     = "available";
     storage   = canvas.GetComponentInChildren <InventoryBehavior>();
     dumpSpawn = GameObject.FindGameObjectWithTag("DumpSpawnPoint");
     canvas.SetActive(false);
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        agent             = GetComponent <NavMeshAgent>();
        inventoryBehavior = GameObject.Find("InventoryDisplay").GetComponent <InventoryBehavior>();
        inventoryBehavior.parentCharacterBehavior = this;

        animator = GetComponent <Animator>();
    }
Esempio n. 4
0
 // When user press e in front of the station
 public void gotInteracted()
 {
     if (stage == "available")
     {
         inventory = interactionState.startState(canvas);
         storage.setother(inventory);
         inventory.setother(storage);
         stage = "watingForPickedItems";
     }
 }
Esempio n. 5
0
 internal void Init(Item item, InventoryBehavior inventoryBehavior)
 {
     ItemToUnstack      = item;
     InventoryBehaviour = inventoryBehavior;
     scrollBar          = gameObject.GetComponentInChildren <Scrollbar>();
     scrollBar.onValueChanged.AddListener(OnScrollbarValueChanged);
     scrollBar.value = 0.5f;
     SelectedAmount  = (float)Math.Floor(ItemToUnstack.Quantity * scrollBar.value);
     scrollBar.onValueChanged.Invoke(0.5f);
 }
    // When user press e in front of the station
    public void gotInteracted()
    {
        mainCanvas.SetActive(true);
        inventory = interactionState.startState(canvas);
        trash.setother(inventory);
        inventory.setother(trash);
        inventory.makeAvailableToTransfer(true);
        trash.makeAvailableToTransfer(true);
        GameObject s = trash.allSlots[0];
        Event      e = Event.current;

        EventSystem.current.SetSelectedGameObject(s);
        stage = "watingForPickedItems";
    }
            public void Start(GameObject _parent)
            {
                if (this.m_launcher == null)
                {
                    this.m_launcher = _parent.GetComponent <LauncherBehavior>();
                }

                if (this.m_componentSelector == null)
                {
                    this.m_componentSelector = _parent.GetComponent <ConfigurationSelectorBehavior>();
                }

                if (this.m_inventory == null)
                {
                    this.m_inventory = _parent.GetComponent <InventoryBehavior>();
                }

                this.m_parent = _parent;
            }
Esempio n. 8
0
 // Called when the player already got a recipe
 public string gotInteracted(InventoryBehavior inventory, string thisteam)
 {
     if (team == thisteam)
     {
         List <string> ids = inventory.getAllIds();
         int           i   = 0;
         foreach (string id in ids)
         {
             if (item_requirement == id)
             {
                 inventory.deleteSlot(i);
                 isAssignedToTeam = false;
                 team             = "";
                 setTeamFlag();
                 photonView.RPC("updateNetwork", PhotonTargets.OthersBuffered, team, item_requirement, isAssignedToTeam);
                 return(item_requirement);
             }
             i++;
         }
     }
     return("");
 }
Esempio n. 9
0
    public void gotInteracted(InventoryBehavior inventory, Text message, Image bg)
    {
        mess   = message;
        bgMess = bg;
        Item i = GetComponent <Item>();

        if (inventory.AddItem(i))
        {
            photonView.RPC("hideAndShowIngre", PhotonTargets.AllBuffered);

            //string ingredientName = this.gameObject.GetComponent<Item>().id;
            //mess.text = string.Format("Added {0} into inventory", ingredientName);
        }
        else
        {
            mess.text = string.Format("Need more room in inventory");

            bgMess.enabled = true;
            Invoke("ClearText", 3);
        }
        //bgMess.enabled = true;
        //Invoke("ClearText", 2);
    }
 public void setother(InventoryBehavior ib)
 {
     other = ib;
 }
 public void setInteractacState(InteractionState iState, GameObject instr_icons)
 {
     interactionState = iState;
     inventory        = iState.inventory;
     perm_icons       = instr_icons;
 }