ObjectInteraction.PutItemAway C# (CSharp) Method

PutItemAway() public method

public PutItemAway ( int SlotNo ) : bool
SlotNo int
return bool
    public bool PutItemAway(int SlotNo)
    {
        //What happens when an item is put into a backpack
                inventorySlot=SlotNo;
                object_base item=null;
                item=this.GetComponent<object_base>();
                if( item !=null)
                {
                        return (item.PutItemAwayEvent(SlotNo));
                }
                else
                {
                        return false;
                }
    }

Usage Example

Ejemplo n.º 1
0
    /* public string GetObjectInHand()
     * {
     *   return ObjectInHand;
     * }*/

    /* public GameObject GetGameObjectInHand()
     * {
     *   if (ObjectInHand != null)
     *       {
     *       return ObjectInHand.gameObject;
     *   }
     *   else
     *   {
     *       return null;
     *   }
     *
     *   //if (ObjectInHand != "")
     *   //{
     *   //    return GameObject.Find(ObjectInHand);
     *   //}
     *   //else
     *   //{
     *   //    return null;
     *   }
     *
     * }*/

    /*  public ObjectInteraction GetObjIntInHand()
     * {
     *    if (ObjectInHand != "")
     *    {
     *        GameObject obj = GetGameObjectInHand();
     *        if (obj != null)
     *        {
     *            return obj.GetComponent<ObjectInteraction>();
     *        }
     *    }
     *    return null;
     * }*/

    //public void SetObjectInHand(GameObject obj)
    //{
    //	ObjectInHand=obj.name;
    //}

    /*  public void SetObjectInHand(string obj)
     * {
     *    ObjectInHand = obj;
     * }*/

    //public Container GetCurrentContainer()
    //{
    //    return GameObject.Find(currentContainer).GetComponent<Container>();
    //}

    //public GameObject GetGameObject(string name)
    //{
    //    return GameObject.Find(name);
    //}

    public void PutItemAwayEvent(short slotNo)
    {
        ObjectInteraction objInt = GetObjectIntAtSlot(slotNo);

        if (objInt != null)
        {
            objInt.PutItemAway(slotNo);
        }
    }
All Usage Examples Of ObjectInteraction::PutItemAway