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;
                    }
                }
            }
        }
예제 #2
0
 private void EnemyKilled(MobDeathEventInfo mdei)
 {
     if (mdei.Killer.Equals(gameObject.name))
     {
         GetExp(mdei.Level * 15);
     }
 }
예제 #3
0
        public override void Die()
        {
            MobDeathEventInfo udei = new MobDeathEventInfo();

            udei.Unit   = this;
            udei.Killer = this.killer;
            udei.Level  = this.m_Level;
            EventSystem.Current.FireEvent(udei);
            // GameObject teleporter = Instantiate(m_Teleporter, transform.position, Quaternion.Euler(0, 0, 0));
            //  teleporter.SetActive(true);

            Destroy(this.gameObject);
        }
예제 #4
0
        public virtual void Die()
        {
            Bag droppedBag = Instantiate(m_Drop, transform.position, Quaternion.Euler(0, 0, 0));

            droppedBag.gameObject.name = "Bag";
            droppedBag.SetItemByMinMax(0, 5);


            MobDeathEventInfo udei = new MobDeathEventInfo();

            udei.EventDescription = "Unit " + this.tag + " has died";
            udei.Unit             = this;
            udei.Killer           = this.killer;
            udei.Level            = this.m_Level;
            EventSystem.Current.FireEvent(udei);

            Destroy(this.gameObject);
        }