Beispiel #1
0
 public bool BindChild(Actor child)
 {
     if (m_children.Contains(child))
         return false;
     m_children.Add(child);
     child.BindParent(this);
     return true;
 }
Beispiel #2
0
        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();
        }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 public void UnbindParent()
 {
     if (m_parent == null)
         return;
     Actor temp = m_parent;
     m_parent = null;
     temp.UnbindChild(this);
 }
Beispiel #5
0
 public void UnbindChild(Actor child)
 {
     if (!m_children.Contains(child))
     {
         return;
     }
     m_children.Remove(child);
     child.UnbindParent();
 }