Exemple #1
0
 public void Dispose()
 {
     SetParent(null);
     OnParentChanged?.Dispose();
     _children?.Dispose();
     Node = null;
 }
Exemple #2
0
 internal protected virtual void TriggerOnParentChanged(Component sender, Component component)
 {
     if (OnParentChanged != null)
     {
         OnParentChanged.Invoke(new ComponentEventArgs(sender, component));
     }
 }
Exemple #3
0
        /// <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);
        }
Exemple #4
0
 private void fireParentChanged()
 {
     OnParentChanged.FireEvent(this, _args);
 }