public void Remove(TempListElementUI instance) { if (m_actualUsedComponents.Remove(instance)) { instance.Hide(); } else { Debug.LogError($"listview_{this.gameObject.name} does not contains {instance.ElementRectTransform.name}, remove failed"); } }
protected virtual void InternalRemove(TempListElementUI element) { if (element == null) { return; } element.Hide(); if (Application.isEditor && !Application.isPlaying) { GameObject.DestroyImmediate(element.ElementRectTransform.gameObject); } else { GameObject.Destroy(element.ElementRectTransform.gameObject); } }