Skip to content
Snippets Groups Projects
GameplayOptionsMenue_mobile.cs 1.75 KiB
Newer Older
  • Learn to ignore specific revisions
  • using UnityEngine;
    using UnityEngine.UI; //andr
    
    
    public class GameplayOptionsMenue_mobile : MonoBehaviour
    {
    
        public GameObject cllscaleAll_Slider;
        public GameObject cllscaleAll_SliderT;
    
        public GameObject CamSens_Slider;
        public GameObject CamSens_SliderT;
    
    
    
    
        private Color colChangeable = new Color(1f, 1f, 1f, 0.5f);
        private Color colChangeable2 = new Color(1f, 1f, 1f, 0.5f);
    
    
    
        void Start()
        {
    
    MaZiFAU's avatar
    MaZiFAU committed
    
    
        }
    
        private void Update()
        {
            cllscaleAll_Slider.GetComponent<Slider>().value = (float)(UIconfig.colliderScale_all / (UIconfig.colliderScale_all_default * UIconfig.colliderScale_all_SliderMax));
            ScaleColliderAllBttn();
    
    
    MaZiFAU's avatar
    MaZiFAU committed
    
    
            CamSens_Slider.GetComponent<Slider>().value = (float)((UIconfig.camRotatingSensitivity) / (UIconfig.camRotatingSensitivity_default * UIconfig.camRotatingSensitivity_sliderMax));
            CamSensitivityBttn();
    
    MaZiFAU's avatar
    MaZiFAU committed
    
    
    
    
    
        public void ScaleColliderAllBttn()
        {
    
    MaZiFAU's avatar
    MaZiFAU committed
            UIconfig.colliderScale_all = cllscaleAll_Slider.GetComponent<Slider>().value * UIconfig.colliderScale_all_SliderMax * UIconfig.colliderScale_all_default;
            cllscaleAll_SliderT.GetComponent<Text>().text = "Scale of Hitbox for MouseClicks is " + (int)(100 * UIconfig.colliderScale_all / UIconfig.colliderScale_all_default) + "%";
    
    MaZiFAU's avatar
    MaZiFAU committed
    
    
        public void CamSensitivityBttn()
        {
            UIconfig.camRotatingSensitivity = CamSens_Slider.GetComponent<Slider>().value * UIconfig.camRotatingSensitivity_sliderMax * UIconfig.camRotatingSensitivity_default;
            double zwischenRechn = 100 * (UIconfig.camRotatingSensitivity); // /(UIconfig.camRotatingSensitivity_default);
            CamSens_SliderT.GetComponent<Text>().text = "Sensitivity of Camera is " + (int)(zwischenRechn) + "%";
    
    MaZiFAU's avatar
    MaZiFAU committed