public MuscleSettingsManager(Muscle muscle, AdvancedBodyControlsViewController viewController) : base() { this.muscle = muscle; this.viewController = viewController; viewController.Reset(); viewController.SetTitle("Muscle Settings"); strengthSlider = viewController.AddSlider("Strength"); strengthSlider.onValueChanged += delegate(float value) { var oldData = muscle.MuscleData; var strength = SliderToStrength(value); if (strength != oldData.strength) { DataWillChange(); } var data = new MuscleData( oldData.id, oldData.startBoneID, oldData.endBoneID, strength, oldData.canExpand ); muscle.MuscleData = data; Refresh(); }; canExpandToggle = viewController.AddToggle("Can Expand"); canExpandToggle.onValueChanged += delegate(bool canExpand) { var oldData = muscle.MuscleData; if (canExpand != oldData.canExpand) { DataWillChange(); } var data = new MuscleData( oldData.id, oldData.startBoneID, oldData.endBoneID, oldData.strength, canExpand ); muscle.MuscleData = data; Refresh(); }; Refresh(); }
public JointSettingsManager(Joint joint, AdvancedBodyControlsViewController viewController) : base() { this.joint = joint; this.viewController = viewController; viewController.Reset(); viewController.SetTitle("Joint Settings"); weightSlider = viewController.AddSlider("Weight"); weightSlider.onValueChanged += delegate(float value) { var oldData = joint.JointData; var weight = SliderToWeight(value); if (weight != oldData.weight) { DataWillChange(); } var data = new JointData(oldData.id, oldData.position, weight); joint.JointData = data; Refresh(); }; Refresh(); }
public BoneSettingsManager(Bone bone, AdvancedBodyControlsViewController viewController) : base() { this.bone = bone; this.viewController = viewController; viewController.Reset(); viewController.SetTitle("Bone Settings"); weightSlider = viewController.AddSlider("Weight"); weightSlider.onValueChanged += delegate(float value) { var oldData = bone.BoneData; var weight = SliderToWeight(value); if (weight != oldData.weight) { DataWillChange(); } var data = new BoneData( oldData.id, oldData.startJointID, oldData.endJointID, weight ); bone.BoneData = data; Refresh(); }; Refresh(); }