Пример #1
0
        private void HandleHotkeys()
        {
            var cameraComponent = OrbitCamera.GetComponent <Camera>();

            if (Input.GetKeyDown(ToggleFine))
            {
                FineTuneMode ^= true;
            }

            if (Input.GetKey(ZoomIn))
            {
                if (Input.GetKey(Modifier))
                {
                    OrbitCamera.SetDistance(OrbitCamera.distance - TrueMoveRate);
                }
                else
                {
                    cameraComponent.fieldOfView -= TrueFOVChange;
                }
            }
            else if (Input.GetKey(ZoomOut))
            {
                if (Input.GetKey(Modifier))
                {
                    OrbitCamera.SetDistance(OrbitCamera.distance + TrueMoveRate);
                }
                else
                {
                    cameraComponent.fieldOfView += TrueFOVChange;
                }
            }

            if (Input.GetKeyDown(EyeToCam))
            {
                if (GameMain.Instance.CharacterMgr.GetMaidCount() > 0)
                {
                    GameMain.Instance.CharacterMgr.GetMaid(0).EyeToCamera(EyeToCamMode, 0.8f);
                    EyeToCamMode = EyeToCamMode.NextEnum(1);
                }
            }

            if (Input.GetKey(FOVReset))
            {
                cameraComponent.fieldOfView = DefaultFOV;
            }

            if (Input.GetKeyDown(Screenshot))
            {
                MainCamera.ScreenShot(Input.GetKey(Modifier));
            }

            if (Input.GetKey(Reset))
            {
                if (Input.GetKey(Modifier))
                {
                    cameraComponent.transform.rotation = OriginalRotation;
                    OrbitCamera.SetDistance(DefaultDistance);
                }
                else
                {
                    OrbitCamera.SetTargetPos(OriginalPosition);
                }
            }
        }