1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using UnityEngine;
- using System.Collections;
- namespace CurvedUI
- {
-
-
-
- public class CUI_GunMovement : MonoBehaviour
- {
- #pragma warning disable 0649
- [SerializeField]
- CurvedUISettings mySettings;
- [SerializeField]
- Transform pivot;
- [SerializeField]
- float sensitivity = 0.1f;
- Vector3 lastMouse;
- #pragma warning restore 0649
-
- void Start()
- {
- lastMouse = Input.mousePosition;
- }
-
- void Update()
- {
- Vector3 mouseDelta = Input.mousePosition - lastMouse;
- lastMouse = Input.mousePosition;
- pivot.localEulerAngles += new Vector3(-mouseDelta.y, mouseDelta.x, 0) * sensitivity;
-
- Ray myRay = new Ray(this.transform.position, this.transform.forward);
- CurvedUIInputModule.CustomControllerRay = myRay;
- CurvedUIInputModule.CustomControllerButtonState = Input.GetButton("Fire1");
- }
- }
- }
|