public override void Destory() { //clear npc if (m_Npc != null) { m_Npc.Distructor(); } if (null != m_CreatedNpcObject) { GameObject.Destroy(m_CreatedNpcObject); } }
public void DestroyNpcById(int id) { Npc instance = null; if (m_NpcMap.TryGetValue(id, out instance)) { instance.Distructor(); m_NpcMap.Remove(id); } else { Debuger.LogWarning("can't find npc by id" + id); } }