private void OnUnitDied(MobDeathEventInfo obj)
        {
            for (int i = 0; i < m_EnemyName.Count; i++)
            {
                if (m_EnemyName[i] == obj.Unit.gameObject.name)
                {
                    m_CurrentNumber++;
                    m_QuestNumberOfDoneText.text = m_CurrentNumber.ToString();
                    Debug.Log("Killed " + m_CurrentNumber + " out of " + m_NumberToKill);

                    if (m_CurrentNumber >= m_NumberToKill)
                    {
                        MobQuestDoneEventInfo me = new MobQuestDoneEventInfo();
                        me.MobName = m_EventEnemyName;
                        EventSystem.Current.FireEvent(me);

                        QuestDoneEventInfo qd = new QuestDoneEventInfo();
                        qd.EventDescription = "Quest \"" + m_QuestName + "\" has been completed!";
                        qd.QuestID          = m_QuestId;
                        EventSystem.Current.FireEvent(qd);
                        m_CurrentNumber = -1;
                        EventSystem.Current.UnregisterListener <MobDeathEventInfo>(DeathEventGuid);

                        break;
                    }
                }
            }
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 3
0
        private void QuestDone(QuestDoneEventInfo qd)
        {
            string questDesc = qd.EventDescription;

            m_Quests.RemoveAt(0);
            if (m_Quests.Count >= 1)
            {
                questNumberInt++;
                Debug.Log(m_CurrentQuest.name);
                m_CurrentQuest = Instantiate(m_Quests[0], this.transform);
                m_CurrentQuest.SetQuestUI(m_QuestName, m_QuestDoneSoFar);
                m_QuestNumber.text = "Küldetések: " + questNumberInt + "/" + m_Quests.Count;
            }
        }