Exemplo n.º 1
0
        public void Remove(DomNode parent, DomNode child, ChildInfo chInfo)
        {
            NativeObjectAdapter childObject  = child.As <NativeObjectAdapter>();
            NativeObjectAdapter parentObject = parent.As <NativeObjectAdapter>();

            object listIdObj = chInfo.GetTag(NativeAnnotations.NativeElement);

            if (childObject == null || parentObject == null || listIdObj == null)
            {
                return;
            }

            uint  listId   = (uint)listIdObj;
            uint  typeId   = (uint)chInfo.DefiningType.GetTag(NativeAnnotations.NativeType);
            ulong parentId = parentObject.InstanceId;
            ulong childId  = childObject.InstanceId;

            GameEngine.ObjectRemoveChild(typeId, listId, parentId, childId);
            if (ManageNativeObjectLifeTime)
            {
                GameEngine.DestroyObject(childObject);
            }
        }