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;
                    }
                }
            }
        }
Esempio n. 2
0
        private void EnemyQuestDone(MobQuestDoneEventInfo mqe)
        {
            switch (mqe.MobName)
            {
            case "dummy":
                m_TeleportedToTheCave.SetActive(true);
                break;

            case "mage":
                m_TeleporterToSecondBoss.SetActive(true);
                break;

            default:
                break;
            }
        }