ObjectInteraction.Equip C# (CSharp) Method

Equip() public method

public Equip ( int SlotNo ) : bool
SlotNo int
return bool
    public bool Equip(int SlotNo)
    {
        //To handle what happens when an item (typically armour is equipped
                //Debug.Log ("Equip Event on " + this.gameObject.name);
                inventorySlot=SlotNo;
                object_base item=null;
                item=this.GetComponent<object_base>();
                if( item !=null)
                {
                        return (item.EquipEvent(SlotNo));
                }
                else
                {
                        return false;
                }
    }

Usage Example

Ejemplo n.º 1
0
    public void EquipItemEvent(short slotNo)
    {//This must be called after the item is finally set.
        ObjectInteraction objInt = GetObjectIntAtSlot(slotNo);

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