예제 #1
0
 public virtual void ChangeOwner(CEntity newOwner)
 {
     Debug.Assert(m_owner != null);
     m_owner.UnregisterComponent(this);
     newOwner.RegisterComponent(this);
     m_owner = newOwner;
 }
예제 #2
0
        internal void RegisterComponent(CEntity owner)
        {
            m_owner = owner;
            m_owner.RegisterComponent(this);

            Name = GetComponentName(this);
            Id   = m_owner.ComponentCounter;

            if (ComponentGuid == Guid.Empty)
            {
                ComponentGuid = Guid.NewGuid();
            }
        }