Example #1
0
    void HandleKeyInput()
    {
        // update radar zoom / indicator border input
        if (Input.GetKey(KeyCode.X) && _HUDNavigationSystem.radarZoom < 5f)
        {
            _HUDNavigationSystem.radarZoom += .0175f;
        }
        else if (Input.GetKey(KeyCode.C) && _HUDNavigationSystem.radarZoom > .25f)
        {
            _HUDNavigationSystem.radarZoom -= .0175f;
        }
        else if (Input.GetKey(KeyCode.V) && _HUDNavigationSystem.indicatorOffscreenBorder < .7f)
        {
            _HUDNavigationSystem.indicatorOffscreenBorder += .01f;
        }
        else if (Input.GetKey(KeyCode.B) && _HUDNavigationSystem.indicatorOffscreenBorder > .07f)
        {
            _HUDNavigationSystem.indicatorOffscreenBorder -= .01f;
        }
        else if (Input.GetKey(KeyCode.N) && _HUDNavigationSystem.minimapScale > .06f)
        {
            _HUDNavigationSystem.minimapScale -= .01f;
        }
        else if (Input.GetKey(KeyCode.M) && _HUDNavigationSystem.minimapScale < 1f)
        {
            _HUDNavigationSystem.minimapScale += .01f;
        }

        // update feature enable / disable input
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            _HUDNavigationSystem.EnableRadar(!_HUDNavigationSystem.useRadar);
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            _HUDNavigationSystem.EnableCompassBar(!_HUDNavigationSystem.useCompassBar);
        }
        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            _HUDNavigationSystem.EnableIndicators(!_HUDNavigationSystem.useIndicators);
        }
        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            _HUDNavigationSystem.EnableMinimap(!_HUDNavigationSystem.useMinimap);
        }

        // toggle radar / minimap mode
        if (Input.GetKeyDown(KeyCode.Alpha5))
        {
            _HUDNavigationSystem.radarMode = (_HUDNavigationSystem.radarMode == RadarModes.RotateRadar) ? RadarModes.RotatePlayer : RadarModes.RotateRadar;
        }
        if (Input.GetKeyDown(KeyCode.Alpha6))
        {
            _HUDNavigationSystem.minimapMode = (_HUDNavigationSystem.minimapMode == MinimapModes.RotateMinimap) ? MinimapModes.RotatePlayer : MinimapModes.RotateMinimap;
        }

        // toggle minimap custom layers
        if (Input.GetKeyDown(KeyCode.Alpha7) && _HUDNavigationSystem.minimapProfile != null)
        {
            GameObject blackWhiteLayer = _HUDNavigationSystem.minimapProfile.GetCustomLayer("blackWhite");
            if (blackWhiteLayer != null)
            {
                blackWhiteLayer.SetActive(!blackWhiteLayer.activeSelf);
            }
        }
    }