// if rotation is slected, set the slider values according the the // current rotation value of the selected object private void SetSliderValues(int inTransformationMode) { if (inTransformationMode == (int)TransformationMode.Rotate) { Vector3 rot = mouseClickDetection.GetSelectedGameObject().transform.localRotation.eulerAngles; for (int i = 0; i < axisControl.childCount; i++) { //axisControl.Get } Slider[] childrenSliders = axisControl.GetComponentsInChildren <Slider>(); foreach (Slider slider in childrenSliders) { if (slider.gameObject.name == "x") { slider.value = rot.x; } else if (slider.gameObject.name == "y") { slider.value = rot.y; } else { slider.value = rot.z; } } } }
// TODO : I see no use of this as of now, maybe delete later public void SetUp(MouseClickDetection inMouseClickDetection) { mouseClickDetection = inMouseClickDetection; selectedGameObject = mouseClickDetection.GetSelectedGameObject(); }