Esempio n. 1
0
        public void OnAddToDocument(XLEBridgeUtils.INativeDocumentAdapter doc)
        {
            var node    = DomNode;
            var docTest = (node != null) ? node.GetRoot().As <NativeDocumentAdapter>() : null;

            System.Diagnostics.Debug.Assert(doc == docTest);
            CreateNativeObject();
        }
Esempio n. 2
0
 public void OnRemoveFromDocument(XLEBridgeUtils.INativeDocumentAdapter doc)
 {
     // Note --  potential issues here if there are currently locks on the
     //          terrain. The unload won't succeed in that case.
     if (m_isLoaded)
     {
         Unload();
     }
 }
Esempio n. 3
0
 // protected override void OnNodeSet() {}
 public void OnAddToDocument(XLEBridgeUtils.INativeDocumentAdapter doc)
 {
     // This should be called after the node is fully created and the
     // terrain is ready to be loaded. We can call Reload() to build
     // the native terrain from here.
     if (!m_isLoaded)
     {
         Reload();
     }
 }
Esempio n. 4
0
        public void OnRemoveFromDocument(XLEBridgeUtils.INativeDocumentAdapter doc)
        {
            if (DomNode == null || m_instanceId == 0)
            {
                return;
            }

            ulong documentId = (doc != null) ? doc.NativeDocumentId : 0;

            System.Diagnostics.Debug.Assert(documentId == m_documentId);

            GameEngine.DestroyObject(m_documentId, m_instanceId, TypeId);
            GameEngine.DeregisterGob(m_documentId, m_instanceId, this);
            ReleaseNativeHandle();
        }