public void OnPointerClick(PointerEventData eventData) { Vector2 mousePos = new Vector2(); RectTransformUtility.ScreenPointToLocalPointInRectangle(rectMain, Input.mousePosition, Camera.main, out mousePos); Debug.Log("CLICK POS: " + mousePos); // origin and terminus must not be the same, disallowed in every state if (_markersFSM.GetCurMarkerState() == MarkersFSM.MarkerState.MARKER_START && _markersFSM.GetOrigin().x == mousePos.x && _markersFSM.GetOrigin().y == mousePos.y) { return; } _curStateEntity.MarkerClickHandler(mousePos, eventData, lCtrlHold, lAltHold); }