public void Dispose() { SetParent(null); OnParentChanged?.Dispose(); _children?.Dispose(); Node = null; }
internal protected virtual void TriggerOnParentChanged(Component sender, Component component) { if (OnParentChanged != null) { OnParentChanged.Invoke(new ComponentEventArgs(sender, component)); } }
/// <summary> /// If there is different Parent now, removes it and sets newParent as Parent. /// </summary> /// <param name="newParent"></param> public void ChangeParent(IWorldObject newParent) { OnParentChanging?.Invoke(newParent); if (Parent != null) { RemoveParent(); } Parent = newParent; OnParentChanged?.Invoke(Parent); }
private void fireParentChanged() { OnParentChanged.FireEvent(this, _args); }