Ejemplo n.º 1
0
    public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus)
    {
        if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED ||
            newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
        {
            GameObject.Find("pnlPausa").SetActive(true);
            GameObject.Find("pnlPausa").GetComponent <RectTransform> ().localScale = Vector3.zero;
            if (reglas.getLista().Count > 0)
            {
                Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
                OnTrackingFound();

                string obj1 = reglas.GetDescripcion(mTrackableBehaviour.TrackableName);
                txtFind.text = obj1;

                if (!obj1.Equals(txtTarget.text))
                {
                    GameObject.Find("pnlPausa").SetActive(true);
                    GameObject.Find("pnlPausa").GetComponent <RectTransform> ().localScale = new Vector3(0.3f, 0.5f, 1f);
                    MostrarPanel();
                }
            }
        }
        else if (previousStatus == TrackableBehaviour.Status.TRACKED && newStatus == TrackableBehaviour.Status.NO_POSE)
        {
            Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " lost");
            OnTrackingLost();

            string obj1 = reglas.GetDescripcion(mTrackableBehaviour.TrackableName);
            txtFind.text = obj1;
            GameObject.Find("txtStatus").GetComponent <Text> ().text = "";

            if (obj1.Equals(txtTarget.text))
            {
                GameObject.Find("pnlValidar").GetComponent <RectTransform> ().localScale = new Vector3(0.3f, 0.4f, 1f);
                GameObject.Find("pnlDatos").GetComponent <RectTransform> ().localScale   = new Vector3(1f, 0.05f, 1f);
                txtBase.text   = Juego.getVolumen(txtTarget.text, 1).ToString();
                txtAltura.text = Juego.getVolumen(txtTarget.text, 2).ToString();
                GameObject.Find("lblAltura").GetComponent <RectTransform> ().localScale = Vector3.zero;
                GameObject.Find("txtAltura").GetComponent <RectTransform> ().localScale = Vector3.zero;
                lblObjetivo.text = "Escribe en el cuadro de texto el resultado del cálculo del Área y presiona Aceptar";

                txtApotema.text = Juego.getVolumen(txtTarget.text, 3).ToString();
                if (mTrackableBehaviour.TrackableName.Contains("Cil"))
                {
                    lblBase.text    = "Radio";
                    lblApotema.text = "Pi";
                }
                else if (mTrackableBehaviour.TrackableName.Contains("Triang"))
                {
                    lblApotema.text = "Altura";
                    lblBase.text    = "Base";
                }
                else if (mTrackableBehaviour.TrackableName.Contains("gonal"))
                {
                    lblBase.text    = "Lado";
                    lblApotema.text = "Apotema";
                }
                else if (mTrackableBehaviour.TrackableName.Contains("Cuadra"))
                {
                    lblBase.text    = "Lado";
                    lblApotema.text = "Lado";
                }
            }
        }

        else
        {
            OnTrackingLost();
        }
    }
Ejemplo n.º 2
0
 public void GetLista()
 {
     terminados = reglas.getLista();
 }