void OnPress(bool pressed) {
if (pressed) {
if (UICamera.currentTouchID == (int)menuButton) {
RaycastHit hit;
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, Mathf.Infinity)) {
ShipComponent hitComponenent = hit.transform.GetComponent<ShipComponent>();
if (hitComponenent) {
if (hitComponenent == _selectShipComponent.selectedComponent) {
EnableCountdownForMenu();
_menuPos = Input.mousePosition;
}
}
}
}
} else {
DisableCountdownForMenu();
DestroyMenu();
}
}