Seven is the number.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
628 B

4 years ago
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Camera_control : MonoBehaviour {
  5. public float speedH = 2.0f;
  6. public float speedV = 2.0f;
  7. private float yaw = 0.0f;
  8. private float pitch = 0.0f;
  9. // Use this for initialization
  10. void Start () {
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. if (Input.GetMouseButton(1))
  16. {
  17. yaw += speedH * Input.GetAxis("Mouse X");
  18. pitch -= speedV * Input.GetAxis("Mouse Y");
  19. transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
  20. }
  21. }
  22. }