예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
		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);
		}
예제 #4
0
		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);
		}
예제 #5
0
		private void Scene_GameObjectUnregistered(object sender, GameObjectEventArgs e)
		{
			if (this.camObj == e.Object) this.SetCurrentCamera(null);
		}
예제 #6
0
		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);
		}