Beispiel #1
0
    public void Update()
    {
        if (leftChangeVal != 0)
        {
            var changeVal = ChangeValHand();

            TransformCam.position = MoveThruY(TransformCam, MIN_Y, MAX_Y, changeVal);
            TransformCam.LookAt(_target);
        }
    }
Beispiel #2
0
    public void RotateCamHor(Transform helpCam360GrabPosY, Transform helpCam360MainY,
                             Transform target, float camSensivity)
    {
        TransformCam.parent = helpCam360GrabPosY.transform;
        float changeValue = 0;

        bool qOrE = false;

        if (Input.GetKey(KeyCode.Q) && (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)))
        {
            qOrE        = true;
            changeValue = .1f * camSensivity;
        }
        else if (Input.GetKey(KeyCode.Q))
        {
            qOrE        = true;
            changeValue = .4f * camSensivity;
        }

        if (Input.GetKey(KeyCode.E) && (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)))
        {
            qOrE        = true;
            changeValue = -.1f * camSensivity;
        }
        else if (Input.GetKey(KeyCode.E))
        {
            qOrE        = true;
            changeValue = -.4f * camSensivity;
        }

        //when Q or E this wont work
        if (Input.GetAxis("Mouse X") != 0 && !qOrE)
        {
            changeValue = Input.GetAxis("Mouse X") * camSensivity;
        }
        if (Input.GetAxis("Horizontal") != 0 && !qOrE)
        {
            changeValue = Input.GetAxis("Horizontal") * camSensivity;
        }

        if (changeValue != 0)
        {
            helpCam360MainY.transform.Rotate(new Vector3(0, changeValue, 0));
            TransformCam.LookAt(target);

            //leftChangeVal = changeValue;

            if (TutoWindow.IsStepReady("CamRot.Tuto"))
            {
                Program.gameScene.TutoStepCompleted("CamRot.Tuto");
            }
        }
    }