public void AddReagentSolid(ReagentsSolid reagent)
    {
        Debug.Log("added " + reagent.name + " in inventory!");

        reagent.gameObject.layer = 10;
        foreach (Transform child in reagent.transform)
        {
            child.gameObject.layer = 10;
        }
        reagentsSolid.Add(reagent, reagent.gameObject);
        UpdateInventory();
    }
 public void RemoveReagentSolid(ReagentsSolid reagent)
 {
     if (reagentsSolid.ContainsKey(reagent))
     {
         reagent.gameObject.layer = 0;
         foreach (Transform child in reagent.transform)
         {
             child.gameObject.layer = 0;
         }
         reagentsSolid.Remove(reagent);
         UpdateInventory();
     }
 }
Exemplo n.º 3
0
    void Start()
    {
        // TODO: alterar para utilizar o inventory manager
        inventory = FindObjectOfType(typeof(InventoryController)) as InventoryController;

        if (!isSolid)
        {
            reagent = this.GetComponent <ReagentsLiquid> ();
            reagent.GetInfo(objectName);
        }
        else
        {
            reagentSolid            = this.GetComponent <ReagentsSolid>();
            reagentSolid.name       = solidName;
            reagentSolid.liquidName = objectName;
        }

        // TODO: verificar se isso realmente eh necessario, me parece redundante -> hardcode
        originalScale = this.transform.localScale;
        BoxCollider col = this.GetComponent <Collider>() as BoxCollider;

        originalColliderPosition = col.center;
        originalColliderSize     = col.size;
    }