예제 #1
0
        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();
            }
        }
예제 #2
0
 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);
     }
 }
예제 #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;
            }
        }