// Setting Listeners private void SetListeners() { ObjectButtonApply.transform.GetComponent <Button>().onClick.AddListener(ButtonActionApply); ObjectButtonBarrier.transform.GetComponent <Button>().onClick.AddListener(ButtonActionBarrier); ObjectButtonGameFairness.transform.GetComponent <Button>().onClick.AddListener(ButtonActionGameFairness); ObjectSliderBallMaxSpeed.GetComponent <Slider>().onValueChanged.AddListener(delegate { SliderActionBallMaxSpeed(); }); ObjectSliderGravityScale.GetComponent <Slider>().onValueChanged.AddListener(delegate { SliderActionGravityScale(); }); ObjectSliderPaddleSpeedLeft.GetComponent <Slider>().onValueChanged.AddListener(delegate { SliderActionPaddleSpeedLeft(); }); ObjectSliderPaddleSpeedRight.GetComponent <Slider>().onValueChanged.AddListener(delegate { SliderActionPaddleSpeedRight(); }); ObjectSliderPaddleReflectLeft.GetComponent <Slider>().onValueChanged.AddListener(delegate { SliderActionPaddleReflectLeft(); }); ObjectSliderPaddleReflectRight.GetComponent <Slider>().onValueChanged.AddListener(delegate { SliderActionPaddleReflectRight(); }); }
private void UpdateGameplaySlidersWithOldValues() { ObjectSliderBallMaxSpeed.GetComponent <Slider>().value = OldBallSpeed / BufferBallSpeed; ObjectSliderBallMaxSpeed.GetComponent <Slider>().transform.Find("value").GetComponent <Text>().text = OldBallSpeed.ToString(); ObjectSliderGravityScale.GetComponent <Slider>().value = OldGravityScale; ObjectSliderGravityScale.GetComponent <Slider>().transform.Find("value").GetComponent <Text>().text = OldGravityScale.ToString(); ObjectSliderPaddleSpeedLeft.GetComponent <Slider>().value = OldPaddleSpeedLeft / BufferPaddleSpeed; ObjectSliderPaddleSpeedLeft.GetComponent <Slider>().transform.Find("value").GetComponent <Text>().text = OldPaddleSpeedLeft.ToString(); ObjectSliderPaddleSpeedRight.GetComponent <Slider>().value = OldPaddleSpeedRight / BufferPaddleSpeed; ObjectSliderPaddleSpeedRight.GetComponent <Slider>().transform.Find("value").GetComponent <Text>().text = OldPaddleSpeedRight.ToString(); ObjectSliderPaddleReflectLeft.GetComponent <Slider>().value = (OldPaddleReflectLeft - 1) / BufferPaddleReflect; ObjectSliderPaddleReflectLeft.GetComponent <Slider>().transform.Find("value").GetComponent <Text>().text = OldPaddleReflectLeft.ToString(); ObjectSliderPaddleReflectRight.GetComponent <Slider>().value = (OldPaddleReflectRight - 1) / BufferPaddleReflect; ObjectSliderPaddleReflectRight.GetComponent <Slider>().transform.Find("value").GetComponent <Text>().text = OldPaddleReflectRight.ToString(); }
private void SliderActionGravityScale() { NewGravityScale = ObjectSliderGravityScale.GetComponent <Slider>().value; ObjectSliderGravityScale.transform.Find("value").GetComponent <Text>().text = NewGravityScale.ToString(); }