void Update()
        {
            if (inLevel)
            {
                StarCount();
                if (npcm.GetWaitingNPC() == null)
                {
                    NPCText.text = "The Knight Wants:";
                }
                else if (npcm.GetWaitingNPC() != null)
                {
                    NPCText.text = "The Knight Wants:" + "\n" + npcm.GetWaitingNPC().GetNPCPotion();
                }
            }

            if (t.timeInRound <= 0 && inLevel)
            {
                StartCoroutine(EndOfLevel());
            }

            if (isMapActive)
            {
                map.gameObject.SetActive(true);
            }
            else if (!isMapActive)
            {
                map.gameObject.SetActive(false);
            }
            Debug.Log(levelGold);

            /*
             * if(Input.GetKeyDown(KeyCode.Space))
             * {
             *  SetGoldGoal(1000);
             *  SceneManager.LoadScene(1);
             *  Debug.Log(levelGoldGoal);
             * }
             */
        }
Exemplo n.º 2
0
        private void OnTriggerEnter(Collider other)
        {
            if (other.CompareTag("Bottle"))
            {
                if (npcgm.GetWaitingNPC().GetNPCPotion().ToString() == other.GetComponent <Bottle>().GetPotionInBottleName().ToString())
                {
                    Debug.Log("That was the right potion!");
                    Debug.Log(npcgm.GetWaitingNPC().GetNPCPotion().ToString());
                    Debug.Log(other.GetComponent <Bottle>().GetPotionInBottleName().ToString());
                    npcgm.GetWaitingNPC().NPCServed(true);
                }
                else if (npcgm.GetWaitingNPC().GetNPCPotion().ToString() != other.GetComponent <Bottle>().GetPotionInBottleName().ToString())
                {
                    Debug.Log("That was the wrong potion!");
                    Debug.Log(npcgm.GetWaitingNPC().GetNPCPotion().ToString());
                    Debug.Log(other.GetComponent <Bottle>().GetPotionInBottleName().ToString());
                    npcgm.GetWaitingNPC().NPCServed(false);
                }

                StartCoroutine(DestroyAfterTime(other.gameObject));
            }
        }