private void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.gameObject.tag.Equals("Hero"))
            {
                if (m_OtherTeleporter)
                {
                    GameObject[] playersToFind = GameObject.FindGameObjectsWithTag("Hero");
                    for (int i = 0; i < playersToFind.Length; i++)
                    {
                        playersToFind[i].transform.position = m_TeleporterToTeleportOut.transform.position;
                    }
                }
                else
                {
                    GameObject[] playersToFind = GameObject.FindGameObjectsWithTag("Hero");
                    for (int i = 0; i < playersToFind.Length; i++)
                    {
                        playersToFind[i].transform.position = new Vector3(m_LocationToTeleport.x, m_LocationToTeleport.y, 0);
                    }
                }

                PlaceFoundEventInfo qd = new PlaceFoundEventInfo();
                qd.PlaceName = m_NameOfTeleportEvent;
                EventSystem.Current.FireEvent(qd);

                gameManager.PlayTeleportSound();
            }
        }
 private void onPlaceFound(PlaceFoundEventInfo info)
 {
     if (m_PlaceName == info.PlaceName)
     {
         QuestDoneEventInfo qd = new QuestDoneEventInfo();
         qd.EventDescription = "Quest \"" + m_QuestName + "\" has been completed!";
         qd.QuestID          = m_QuestId;
         EventSystem.Current.FireEvent(qd);
         EventSystem.Current.UnregisterListener <PlaceFoundEventInfo>(PlaceFoundEventGuid);
     }
 }
Beispiel #3
0
        private void TeleportPlayerToNewPlace(PlaceFoundEventInfo tei)
        {
            switch (tei.PlaceName)
            {
            case "outCave":
                m_TeleportToFirstBoss.SetActive(true);
                SetUpCave();
                StartNormalSound();
                break;

            case "cave":
                StartCaveSound();
                break;

            default:
                break;
            }
        }