private void OnComponentRemoving(object sender, ComponentEventArgs e)
		{
			if (this.ComponentRemoving != null)
				this.ComponentRemoving(sender, e);
		}
Exemple #2
0
        private void Scene_ComponentRemoving(object sender, ComponentEventArgs e)
        {
            // Ignore events during transition
            if (Scene.IsSwitching) return;

            if (!this.buttonShowComponents.Checked)
            {
                GameObjectNode objNode = (e.Component != null && e.Component.GameObj != null) ? this.FindNode(e.Component.GameObj) : null;
                if (objNode != null)
                    objNode.UpdateIcon(e.Component);
                return;
            }

            ComponentNode oldObjNode = this.FindNode(e.Component);
            if (oldObjNode == null) return;

            Node parentNode = oldObjNode.Parent;
            parentNode.Nodes.Remove(oldObjNode);
            this.UnregisterNodeTree(oldObjNode);
        }
		private void OnComponentAdded(object sender, ComponentEventArgs e)
		{
			if (this.ComponentAdded != null)
				this.ComponentAdded(sender, e);
		}
Exemple #4
0
        private void Scene_ComponentAdded(object sender, ComponentEventArgs e)
        {
            // Ignore events during transition
            if (Scene.IsSwitching) return;

            if (!this.buttonShowComponents.Checked)
            {
                GameObjectNode objNode = (e.Component != null && e.Component.GameObj != null) ? this.FindNode(e.Component.GameObj) : null;
                if (objNode != null)
                    objNode.UpdateIcon();
                return;
            }

            // Find the parent node to add to
            Node parentNode = e.Component.GameObj != null ? this.FindNode(e.Component.GameObj) : 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;
            }

            ComponentNode newObjNode = this.ScanComponent(e.Component);
            this.InsertNodeSorted(newObjNode, parentNode);
            this.RegisterNodeTree(newObjNode);
        }
Exemple #5
0
		private void Scene_ComponentAdded(object sender, ComponentEventArgs e)
		{
			if (!this.buttonShowComponents.Checked)
			{
				GameObjectNode objNode = (e.Component != null && e.Component.GameObj != null) ? this.FindNode(e.Component.GameObj) : null;
				if (objNode != null)
					objNode.UpdateIcon();
				return;
			}
			ComponentNode newObjNode = this.ScanComponent(e.Component);
			Node parentNode = e.Component.GameObj != null ? this.FindNode(e.Component.GameObj) : this.objectModel.Root;
			this.InsertNodeSorted(newObjNode, parentNode);
			this.RegisterNodeTree(newObjNode);
		}
		private void Scene_ComponentRemoving(object sender, ComponentEventArgs e)
		{
			if (this.camComp == e.Component) this.SetCurrentCamera(null);
		}
Exemple #7
0
 private void OnComponentRemoving(object sender, ComponentEventArgs e)
 {
     this.ComponentRemoving?.Invoke(sender, e);
 }
Exemple #8
0
 private void OnComponentAdded(object sender, ComponentEventArgs e)
 {
     this.ComponentAdded?.Invoke(sender, e);
 }