Esempio n. 1
0
    private void Update()
    {
        if (Input.GetButtonDown("Interact") && currentObject)
        {
            //Ist dies ein Inventory Objekt?
            if (currentObjectScript.inventory)
            {
                inventory.AddItem(currentObject);
            }
        }

        if (Input.GetButtonDown("Interact") && _endGameObject)
        {
            //Ist dies ein Inventory Objekt?
            if (currentObjectScript.inventory && inventory.InventoryFull() == true)
            {
                inventory.AddItem(_endGameObject);
                GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameStateManager>().YouWin();
            }
        }

        //Benutze die gesammelten Bruchstücke
        if (Input.GetButtonDown("Use") && currentObject)
        {
            Debug.Log("Q was pressed!");
            //Inventar prüfen (ShuttlePiece)
            GameObject ShuttlePiece = inventory.FindItemByType("Nektar");
            if (ShuttlePiece != null)
            {
                //Bruchstücke verwenden - Shuttle Reparieren
                //Von Inventar entfernen
                if (currentObjectScript.inventory)
                {
                    inventory.RemoveItem(inventory.FindItemByType("Nektar"));
                }
            }
            if (ShuttlePiece = null)
            {
                Debug.Log("Can't find a ShuttlePiece!");
            }
        }
    }
Esempio n. 2
0
    public void Collect(string item)
    {
        switch (item)
        {
        case "PV_100": gss.Increase(100); break;

        case "PV_200": gss.Increase(200); break;

        case "PV_500": gss.Increase(500); break;

        case "PV_1000": gss.Increase(1000); break;

        case "PV_2000": gss.Increase(2000); break;

        case "PV_3000": gss.Increase(3000); break;

        case "PV_5000": gss.Increase(5000); break;

        case "PV_10000": gss.Increase(10000); break;

        case "BO_H": hps.IncreaseMax(15); break;

        case "BO_J": pc.IncreaseJumpHeight(); break;

        case "BO_D": pc.IncreaseAttackMult(); break;

        case "CAT_1": gss.SaveCat(1); gss.Increase(2500); break;

        case "CAT_2": gss.SaveCat(2); gss.Increase(2500); break;

        case "CAT_3": gss.SaveCat(3); gss.Increase(2500); break;

        case "CAT_4": gss.SaveCat(0); gss.Increase(2500); break;

        default: pis.AddItem(item); break;
        }
    }