public void UpdateValues() { foreach (ControlTreeNode node in Nodes) { if (node.Name == "Axis") { TreeNodeArray axNode = (TreeNodeArray)node; axNode.UpdateValue(_linkedRotation.Axis); } if (node.Name == "Angle") { TreeNodeFloat angNode = (TreeNodeFloat)node; angNode.UpdateValue(_linkedRotation.Angle); } if (node.Name == "Origin") { TreeNodeVector3 orNode = (TreeNodeVector3)node; orNode.UpdateValue(_linkedRotation.Origin); } if (node.Name == "Rescale") { TreeNodeBool rescaleNode = (TreeNodeBool)node; rescaleNode.UpdateValue(_linkedRotation.Rescale); } } }
private void Configurate() { TreeNodeArray axisNode = new TreeNodeArray("Axis", _linkedRotation.Axis, Enum.GetValues(typeof(Axis))); axisNode.ValueChanged += new TreeNodeValueChangedHandler(On_Axis_Changed); TreeNodeFloat angleNode = new TreeNodeFloat("Angle", _linkedRotation.Angle, -45, 45, 22.5f); angleNode.ValueChanged += new TreeNodeValueChangedHandler(On_Angle_Changed); TreeNodeVector3 originNode = new TreeNodeVector3("Origin", _linkedRotation.Origin); originNode.ValueChanged += new TreeNodeValueChangedHandler(On_Origin_Changed); TreeNodeBool rescaleNode = new TreeNodeBool("Rescale", _linkedRotation.Rescale); rescaleNode.ValueChanged += new TreeNodeValueChangedHandler(On_Rescale_Changed); Nodes.Add(axisNode); Nodes.Add(angleNode); Nodes.Add(originNode); Nodes.Add(rescaleNode); }