void Action() { if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { //pEd = new PointerEventData(es); //pEd.position = Input.GetTouch(0).position; //List<RaycastResult> res = new List<RaycastResult>(); //m_Raycaster.Raycast(pEd, res); //if (res.Count !=0) // return; Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position); RaycastHit hit; Physics.Raycast(ray.origin, ray.direction, out hit, 100f); if (hit.rigidbody == null && !hit.transform.gameObject.tag.Equals("UI")) { clearContainer(); ControlUi.SetActive(false); } else if (hit.rigidbody.tag.Equals("Cont")) { if (ContenedorSelect != null) { ContenedorSelect.indicador.SetActive(false); } ContenedorSelect = hit.rigidbody.gameObject.GetComponent <ContainerCtr>(); ContenedorSelect.indicador.SetActive(true); ControlUi.SetActive(true); uim.assigContainer(ContenedorSelect); } } }
void clearContainer() { if (ContenedorSelect != null) { ContenedorSelect.indicador.SetActive(false); } ContenedorSelect = null; uim.claerContainer(); }
private void Start() { contenerdor = this.GetComponentInParent <ContainerCtr>(); }
public void claerContainer() { selectetContainer = null; }
public void assigContainer(ContainerCtr con) { selectetContainer = con; }