Exemplo n.º 1
0
        public void OnEnable()
        {
            FPSEnabled       = true;
            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;

            InputMode_Text = GameObject.Find("DebugCanvasPhysics/InputModeText");
            InputFieldObj  = GameObject.Find("DebugCanvasPhysics/InputField");
            if (InputMode_Text)
            {
                InputMode_Text.GetComponent <Text>().text = "FPS Mode";
            }


            Debug_Canvas = GameObject.Find("DebugCanvasPhysics");

            Debug_Canvas.GetComponent <Canvas>().enabled = true;
            HideHUD();
        }
Exemplo n.º 2
0
        public void ShowHUD()
        {
            if (InputMode_Text != null)
            {
                InputMode_Text.SetActive(true);
            }
            if (InputFieldObj != null)
            {
                InputFieldObj.SetActive(true);
            }
            if (BackgroundUI != null)
            {
                BackgroundUI.SetActive(true);
            }


            InputFieldObj.GetComponent <Image>().enabled      = true;
            InputFieldObj.GetComponent <InputField>().enabled = true;
            InputFieldObj.GetComponentsInChildren <Text>().ToList().ForEach(x => x.enabled = true);
            Crosshair.GetComponent <Text>().enabled = true;
            ThrowForceBar.SetActive(true);
            TargetText.GetComponent <Text>().enabled = true;
        }
Exemplo n.º 3
0
        public void HideHUD()
        {
            InputMode_Text = GameObject.Find("DebugCanvasPhysics/InputModeText");
            if (InputMode_Text != null)
            {
                InputMode_Text.SetActive(false);
            }
            // InputFieldObj.SetActive(false);

            InputFieldObj.GetComponent <Image>().enabled      = false;
            InputFieldObj.GetComponent <InputField>().enabled = false;
            InputFieldObj.GetComponentsInChildren <Text>().ToList().ForEach(x => x.enabled = false);

            BackgroundUI = GameObject.Find("DebugCanvasPhysics/InputModeText_Background");
            BackgroundUI.SetActive(false);

            Crosshair     = GameObject.Find("DebugCanvasPhysics/Crosshair");
            TargetText    = GameObject.Find("DebugCanvasPhysics/TargetText");
            ThrowForceBar = GameObject.Find("DebugCanvasPhysics/ThrowForceBar");
            Crosshair.GetComponent <Text>().enabled = false;
            ThrowForceBar.SetActive(false);
            TargetText.GetComponent <Text>().enabled = false;
        }