예제 #1
0
    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);
            }
        }
    }
예제 #2
0
 void clearContainer()
 {
     if (ContenedorSelect != null)
     {
         ContenedorSelect.indicador.SetActive(false);
     }
     ContenedorSelect = null;
     uim.claerContainer();
 }
예제 #3
0
 private void Start()
 {
     contenerdor = this.GetComponentInParent <ContainerCtr>();
 }
예제 #4
0
 public void claerContainer()
 {
     selectetContainer = null;
 }
예제 #5
0
 public void assigContainer(ContainerCtr con)
 {
     selectetContainer = con;
 }