| 1234567891011 |
- using System;
- using UnityEngine;
- using UnityEngine.EventSystems;
- namespace BuffaloSiege
- {
- public class FieldInput:MonoBehaviour,IPointerClickHandler
- {
- public Action<Vector2> Click;
- public void OnPointerClick(PointerEventData e){var r=(RectTransform)transform;if(RectTransformUtility.ScreenPointToLocalPointInRectangle(r,e.position,e.pressEventCamera,out var p)){var rect=r.rect;Click?.Invoke(new Vector2((p.x-rect.xMin)/rect.width*430,(rect.yMax-p.y)/rect.height*600));}}
- }
- }
|