Skip to content
Snippets Groups Projects
Select Git revision
  • 54aae6f529b7a7b96c95606617d52d7da00d0c98
  • master default
  • JS-based-scroll-rendering
  • Paul_Marius_Level
  • Paul_Marius_2
  • Paul_Marius
  • Andi_Mark
  • be-UnityWebView
  • gitignoreFrameitServer
  • ZimmerBSc
  • Bugfix_StageLoading
  • stages
  • MAZIFAU_Experimental
  • tsc/coneworld
  • tsc/fact-interaction
  • marcel
  • MaZiFAU_TopSort
  • mergeHelper
  • zwischenSpeichern
  • tempAndrToMaster
  • SebBranch
  • 3.0
  • v2.1
  • v2.0
  • v1.0
25 results

SystemOptionsMenue_mobile.cs

Blame
  • SystemOptionsMenue_mobile.cs 6.85 KiB
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI; //andr
    using UnityEngine.SceneManagement;
    using System.IO; //
    using UnityEngine.Video;//streaming
    using UnityEngine.Networking;
    
    using static UIconfig;
    using static StreamingAssetLoader;
    using static CommunicationEvents;
    
    public class SystemOptionsMenue_mobile : MonoBehaviour
    {
    
        public GameObject AutoOSreq_ButtonT;
        public GameObject AutoOSreq_ButtonUT;
    
        public GameObject Opsys_ButtonT;
        public GameObject Opsys_ButtonUT;
    
        public GameObject FrameITUI_ButtonT;
        public GameObject FrameITUI_ButtonUT;
       
    
    
        /*
        public GameObject TAV_Slider;
        public GameObject TAvisibilityT;
        */
    
        private Color colChangeable = new Color(1f, 1f, 1f, 0.5f);
        private Color colChangeable2 = new Color(1f, 1f, 1f, 0.5f);
    
        //public GameObject TouchModeButton;
    
    
        //public GameObject back_GObj;
    
        void Start()
        {
            UpdateUI_6();
        }
    
        private void Update()
        {
            UpdateUI_6();
        }
    
        void UpdateUI_6()
        {
            switch (CommunicationEvents.autoOSrecognition)
            {
                case false:
    
                    AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: OFF";
                    AutoOSreq_ButtonUT.GetComponent<Text>().text = "Press for activating";
                    break;
    
                case true:
    
                    AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: ON";
                    AutoOSreq_ButtonUT.GetComponent<Text>().text = "Press for deactivating";
                    break;
    
            }
    
            switch (CommunicationEvents.Opsys)
            {
                case OperationSystem.Windows:
    
                    Opsys_ButtonT.GetComponent<Text>().text = "Windows optimized";
                    Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
                    setMouse();
                    break;
    
                case OperationSystem.Android:
    
    
                    Opsys_ButtonT.GetComponent<Text>().text = "Android optimized: No mouse";
                    Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
                    setMouse();
                    break;
    
                default:
    
                    Opsys_ButtonT.GetComponent<Text>().text = "Not optimized";
                    Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
                    break;
            }
            switch (UIconfig.FrameITUIversion)
            {
                case 1:
    
                    FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI";
                    FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
                    break;
    
                case 2:
    
    
                    FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI_mobile: Touchscreen";
                    FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
                    break;
    
                default:
    
                    FrameITUI_ButtonT.GetComponent<Text>().text = "Not optimized";
                    FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
                    break;
            }
            /*
            TAV_Slider.GetComponent<Slider>().value = UIconfig.TAvisibility;
            TAvisibilityT.GetComponent<Text>().text = "Touch area visibility " + (int)(100 * UIconfig.TAvisibility) + "%";
            */
            //updateUIpreview();
        }
    
    
    
        public void ChangeAutoOSrecognition()
        {
            switch (CommunicationEvents.autoOSrecognition)
            {
                case false:
                    CommunicationEvents.autoOSrecognition = true;
                    AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: ON";
                    AutoOSreq_ButtonUT.GetComponentInChildren<Text>().text = "Press for deactivating";
                    break;
    
                case true:
                    CommunicationEvents.autoOSrecognition = false;
                    //GameObject.Find("TextSlotTOO").GetComponent<Text>().text = "Touch controls OFF";
                    AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: OFF";
                    AutoOSreq_ButtonUT.GetComponentInChildren<Text>().text = "Press for activating";
                    break;
    
    
            }
            //updateUIpreview();
            NetworkJSON_Save();
        }
    
        public void ChangeOpsysModes()
        {
            switch (CommunicationEvents.Opsys)
            {
                case OperationSystem.Windows:
                    CommunicationEvents.Opsys = OperationSystem.Android;
                    Opsys_ButtonT.GetComponent<Text>().text = "Android optimized: No Mouse";
                    Opsys_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing optimzation";
    
                    break;
    
                case OperationSystem.Android:
                    CommunicationEvents.Opsys = OperationSystem.Windows;
                    Opsys_ButtonT.GetComponent<Text>().text = "Windows optimized";
                    Opsys_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing optimzation";
                    if (UIconfig.MouseKeepingInWindow == true)
                    {
                        Cursor.lockState = CursorLockMode.Confined;
                    }
                    else
                    {
                        Cursor.lockState = CursorLockMode.None;
                    }
    
                    break;
    
                default:
                    CommunicationEvents.Opsys = OperationSystem.Android;
                    Opsys_ButtonT.GetComponent<Text>().text = "Not optimized";
                    Opsys_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing optimzation";
                    break;
    
            }
            //updateUIpreview();
            NetworkJSON_Save();
        }
    
        public void ChangeFrameITUIvers()
        {
            switch (UIconfig.FrameITUIversion)
            {
                case 1:
                    UIconfig.FrameITUIversion = 2;
                    FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI_mobile: Touchscreen";
                    FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
                    break;
                case 2:
                    UIconfig.FrameITUIversion = 1;
                    FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI";
                    FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
                    break;
    
                default:
                    UIconfig.FrameITUIversion = 1;
                    FrameITUI_ButtonT.GetComponent<Text>().text = "Not optimized";
                    FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
                    break;
    
            }
            //updateUIpreview();
            NetworkJSON_Save();
        }
    
        public void touchAreaVisibilityBttn()
        {
            /*
            UIconfig.TAvisibility = TAV_Slider.GetComponent<Slider>().value;
            TAvisibilityT.GetComponent<Text>().text = "Touch area visibility " + (int)(100 * UIconfig.TAvisibility) + "%";
    
            //updateUIpreview();
            */
        }
    
    
        public void setMouse()
        {
            updateMouseCursor.setMouse();
    
        }
    
    }