void OnDisable() { if (Application.isPlaying) { if (mRevealer != null) { mRevealer.isActive = false; } if (arrow != null) { UIMiniMapBase.inst.DeleteArrow(arrow); } arrow = null; } list.Remove(this); }
/// <summary> /// Remove this unit from the list. /// </summary> void OnDestroy() { if (Application.isPlaying) { if (NJGMapBase.instance != null) { if (NJGMapBase.instance.fow.enabled) { NJGFOW.DeleteRevealer(mRevealer); } } mRevealer = null; if (arrow != null) { UIMiniMapBase.inst.DeleteArrow(arrow); } arrow = null; } list.Remove(this); }