ObjectInteraction.GetWeight C# (CSharp) Method

GetWeight() public method

public GetWeight ( ) : float
return float
    public float GetWeight()
    {
        //Return the weight of the object stack
                return this.GetComponent<object_base>().GetWeight();
                //return (float)(GetQty())*Weight[item_id]*0.1f;
    }

Usage Example

Esempio n. 1
0
    public float getInventoryWeight()
    {
        float answer = 0.0f;

        //Get the weight of all the equipment slots
        for (int i = 0; i <= 10; i++)
        {
            ObjectInteraction objItem = GetObjectIntAtSlot(i);
            if (objItem != null)
            {
                answer += objItem.GetWeight();
            }
        }

        //Get the weight of the gronk container as that is alway the top level of the inventory
        for (short i = 0; i <= playerContainer.MaxCapacity(); i++)
        {
            ObjectInteraction objItem = playerContainer.GetItemAt(i); //GameObject.Find (playerContainer.GetItemAt(i));
            if (objItem != null)
            {
                answer += objItem.GetWeight();
            }
            else
            {
                answer += 0;
            }
        }
        return(answer);
    }
All Usage Examples Of ObjectInteraction::GetWeight