public bool BindChild(Actor child) { if (m_children.Contains(child)) return false; m_children.Add(child); child.BindParent(this); return true; }
public Actor(MyGame theGame) { m_theGame = theGame; //Sets the entity's ID to a unique ID. _ID = currentID; ++currentID; m_parent = null; m_transform = new Transform(); }
public bool BindParent(Actor parent) { if (m_parent == parent) return false; if (m_parent != null) UnbindParent(); m_parent = parent; m_parent.BindChild(this); m_transform.ParentTransform = parent.Transform; return true; }
public void UnbindParent() { if (m_parent == null) return; Actor temp = m_parent; m_parent = null; temp.UnbindChild(this); }
public void UnbindChild(Actor child) { if (!m_children.Contains(child)) { return; } m_children.Remove(child); child.UnbindParent(); }