Ejemplo n.º 1
0
    public static IEnumerator TodayExercisesRqst()
    {
        GameObject l_environmentGO = GameObject.FindGameObjectWithTag("Environment");

        if (l_environmentGO != null)
        {
            VTenvironment l_env = l_environmentGO.GetComponent <VTenvironment>();
            if (l_env != null)
            {
                WWW l_exerciseRqst = new WWW(isOffLine ? "http://localhost/?name=" : "http://194.87.93.103/exersise?name=" + l_env.userName);

                yield return(l_exerciseRqst);

                /*
                 * int l_bodyPos = -1;
                 * l_bodyPos = l_exerciseRqst.text.IndexOf("<body>") + 6;
                 * int l_bodyPosEnd = l_exerciseRqst.text.IndexOf("</body>");
                 * string l_respText = l_exerciseRqst.text.Substring(l_bodyPos, l_bodyPosEnd - l_bodyPos);*/
                if (l_exerciseRqst.text.Length > 0)
                {
                    if (l_exerciseRqst.text[0] != '!')
                    {
                        i_exerciseData = l_exerciseRqst.text.Split(';');
                    }
                }
            }
            else
            {
                UnityEngine.Debug.Log("!!!Environment component not found!!!");
            }
        }
        else
        {
            UnityEngine.Debug.Log("!!!Environment gameobject not found!!!");
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     i_instance = this;
 }