void OnEntityEventListener(int event_id, CSEntity entity, object arg) { CSCommon csc = entity as CSCommon; if (csc == null) { return; } if (event_id == CSConst.eetDestroy) { csc.RemoveEventListener(OnEntityEventListener); CSUI_EntityState es = m_EntitesState.Find(item0 => item0.m_RefCommon == csc); if (es != null) { GameObject.Destroy(es.gameObject); m_EntitesState.Remove(es); m_EntityRootUI.repositionNow = true; } } }