Example #1
0
        private void OnEnable()
        {
            if (CameraHandle != null)
            {
                _camera               = CameraHandle.GetComponentInChildren <Camera>();
                _cameraMovement       = _camera.GetComponent <CameraMovement>();
                _cameraHandleMovement = CameraHandle.GetComponent <CameraHandleMovement>();
                _currentPosition      = CameraHandle.GetComponent <CameraHandleMovement>().GetWatchedPoint();
            }
            if (HotkeyList.transform.childCount == 0) // dont add the same buttons when switching between submenus
            {
                SubmenuBuilder.AddButton(HotkeyAction.ZoomMore, SetHotkeyPrefab, HotkeyList);
                SubmenuBuilder.AddButton(HotkeyAction.ZoomLess, SetHotkeyPrefab, HotkeyList);
                SubmenuBuilder.AddButton(HotkeyAction.RotateLeft, SetHotkeyPrefab, HotkeyList);
                SubmenuBuilder.AddButton(HotkeyAction.RotateRight, SetHotkeyPrefab, HotkeyList);
                SubmenuBuilder.AddButton(HotkeyAction.ActivateFollow, SetHotkeyPrefab, HotkeyList);

                _cameraZoomSlider      = SubmenuBuilder.AddSlider(SliderPrefab, HotkeyList, "Camera Zoom", GameControl.Settings.CameraZoom.Min, GameControl.Settings.CameraZoom.Max, SetCameraZoom);
                _cameraAngleSlider     = SubmenuBuilder.AddSlider(SliderPrefab, HotkeyList, "Camera Angle", GameControl.Settings.CameraAngle.Min, GameControl.Settings.CameraAngle.Max, SetCameraAngle);
                _cameraSpeedSlider     = SubmenuBuilder.AddSlider(SliderPrefab, HotkeyList, "Camera Speed", GameControl.Settings.CameraSpeed.Min, GameControl.Settings.CameraSpeed.Max, SetCameraSpeed);
                _cameraFollowSelection = SubmenuBuilder.AddSelection(SelectionPrefab, HotkeyList, "Follow", FollowCameraSelection);
                _hideMiniMapSelection  = SubmenuBuilder.AddSelection(SelectionPrefab, HotkeyList, "Hide Minimap", HideMiniMapSelection);

                SetSliderValuesFromSettings();
            }
        }
Example #2
0
 private void OnEnable()
 {
     if (HotkeyList.transform.childCount == 0) // dont add the same buttons when switching between submenus
     {
         SubmenuBuilder.AddButton(HotkeyAction.ActivateClicker, SetHotkeyPrefab, HotkeyList);
         SubmenuBuilder.AddButton(HotkeyAction.DeactivateClicker, SetHotkeyPrefab, HotkeyList);
         SubmenuBuilder.AddButton(HotkeyAction.NavigateMenu, SetHotkeyPrefab, HotkeyList);
         SubmenuBuilder.AddButton(HotkeyAction.Pause, SetHotkeyPrefab, HotkeyList);
         SubmenuBuilder.AddButton(HotkeyAction.Ability1, SetHotkeyPrefab, HotkeyList);
         SubmenuBuilder.AddButton(HotkeyAction.Ability2, SetHotkeyPrefab, HotkeyList);
         SubmenuBuilder.AddButton(HotkeyAction.ActivateGodmode, SetHotkeyPrefab, HotkeyList);
         SubmenuBuilder.AddButton(HotkeyAction.DeactiveGodmode, SetHotkeyPrefab, HotkeyList);
     }
 }
Example #3
0
        public void DiscardChanges()
        {
            SubmenuBuilder.DeleteHotkeyPrefabs(SetCamera.HotkeyList);
            SubmenuBuilder.DeleteHotkeyPrefabs(SetHotkeys.HotkeyList);
            GameControl.InputManager.LoadHotkeys();

            if (CameraHandleMovement != null && CameraMovement != null)
            {
                var watchedPoint = CameraHandleMovement.GetWatchedPoint();
                CameraHandleMovement.SetCameraHandlePosition(watchedPoint);
                CameraMovement.SetCameraPitch(GameControl.Settings.CameraAngle.Val);
            }

            GameControl.Settings.LoadSettings();
            _menuManager.Menu.SetActive(true);
        }