Beispiel #1
0
    // Update is called once per frame

    /*void Update () {
     *
     * }*/

    //! Add selected itensType in inventory (glassware, reagent liquid and reagent solid).
    public void ButtonPressed(int index)
    {
        switch (itensType)
        {
        case ItemType.GLASSWARE:
        {
            GameObject item = Instantiate(objectPrefabs[index]) as GameObject;
            inventory.AddGlassware(item.GetComponent <Glassware>());
            item.transform.parent = inventory.transform;
        }
        break;

        case ItemType.REAGENT_LIQUID:
        {
            GameObject item = Instantiate(objectPrefabs[index]) as GameObject;
            inventory.AddReagentLiquid(item.GetComponent <ReagentsLiquid>());
            item.transform.parent = inventory.transform;
        }
        break;

        case ItemType.REAGENT_SOLID:
        {
            GameObject item = Instantiate(objectPrefabs[index]) as GameObject;
            inventory.AddReagentSolid(item.GetComponent <ReagentsSolid>());
            item.transform.parent = inventory.transform;
        }
        break;
        }
    }