123456789101112131415161718192021222324252627 |
- using UnityEngine;
- using System.Collections;
- namespace CurvedUI
- {
- public class CUI_RaycastToCanvas : MonoBehaviour
- {
- CurvedUISettings mySettings;
- // Use this for initialization
- void Start()
- {
- mySettings = GetComponentInParent<CurvedUISettings>();
- }
- // Update is called once per frame
- void Update()
- {
- Vector2 pos = Vector2.zero;
- mySettings.RaycastToCanvasSpace(Camera.main.ScreenPointToRay(Input.mousePosition), out pos);
- this.transform.localPosition = pos;
- }
- }
- }
|