Exemple #1
0
    private void Update()
    {
        if (guiShow)
        {
            if (isBag || bagPickup)
            {
                if (Input.GetKeyDown("e"))
                {
                    Destroy(itemToDestroy);
                    printText.CustomLine(textToDisplay);
                    bagPickup = true;
                    audioSource.Play();
                }
            }
            else
            {
                if (Input.GetKeyDown("e"))
                {
                    printText.CustomLine("I should find my bag first!");
                    audioSource.Play();
                }
            }
            if (!locket)
            {
                if (itemToPickup == global::item.Locket)
                {
                    if (Input.GetKeyDown("e"))
                    {
                        Destroy(itemToDestroy);
                        printText.CustomLine(textToDisplay);
                        bagPickup = true;
                        audioSource.Play();
                        locket = true;
                    }
                }

                if (itemToPickup == global::item.Torch)
                {
                    if (Input.GetKeyDown("e"))
                    {
                        torch.EnableTorch();
                    }
                }
            }
        }
    }
Exemple #2
0
    void OnTriggerStay2D(Collider2D coll)
    {
        if (showImage)
        {
            guiShow = true;
        }
        if (!used)
        {
            if (coll.gameObject.tag == "Player")
            {
                Debug.Log("Collision Happnin");

                if (Input.GetKeyDown("e"))
                {
                    printText.CustomLine(text);
                    used = true;
                }
            }
        }
    }