示例#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;
 }