private void Scene_GameObjectUnregistered(object sender, GameObjectEventArgs e) { // Ignore events during transition if (Scene.IsSwitching) return; GameObjectNode oldObjNode = this.FindNode(e.Object); if (oldObjNode == null) return; Node parentNode = oldObjNode.Parent; parentNode.Nodes.Remove(oldObjNode); this.UnregisterNodeTree(oldObjNode); }
private void Scene_GameObjectRegistered(object sender, GameObjectEventArgs e) { // Ignore events during transition if (Scene.IsSwitching) return; // Ignore already added nodes if (this.FindNode(e.Object) != null) return; // Find the parent node to add to Node parentNode = e.Object.Parent != null ? this.FindNode(e.Object.Parent) : this.objectModel.Root; // No parent node existing? This must be a new object then. if (parentNode == null) { // Let the parent handle it when it registers. return; } // Create a new node and add it GameObjectNode newObjNode = this.ScanGameObject(e.Object, true); this.InsertNodeSorted(newObjNode, parentNode); this.RegisterNodeTree(newObjNode); }
private void Scene_GameObjectRegistered(object sender, GameObjectEventArgs e) { GameObjectNode newObjNode = this.ScanGameObject(e.Object, false); Node parentNode = e.Object.Parent != null ? this.FindNode(e.Object.Parent) : this.objectModel.Root; this.InsertNodeSorted(newObjNode, parentNode); this.RegisterNodeTree(newObjNode); }
private void Scene_GameObjectUnregistered(object sender, GameObjectEventArgs e) { GameObjectNode oldObjNode = this.FindNode(e.Object); if (oldObjNode == null) return; Node parentNode = oldObjNode.Parent; parentNode.Nodes.Remove(oldObjNode); this.UnregisterNodeTree(oldObjNode); }
private void Scene_GameObjectUnregistered(object sender, GameObjectEventArgs e) { if (this.camObj == e.Object) this.SetCurrentCamera(null); }
private void Scene_GameObjectRegistered(object sender, GameObjectEventArgs e) { // Ignore events during transition if (Scene.IsSwitching) return; GameObjectNode newObjNode = this.ScanGameObject(e.Object, false); Node parentNode = e.Object.Parent != null ? this.FindNode(e.Object.Parent) : this.objectModel.Root; this.InsertNodeSorted(newObjNode, parentNode); this.RegisterNodeTree(newObjNode); }