Exemple #1
0
 void OnMouseDown()
 {
     //GR = GameObject.FindGameObjectWithTag("Canvas").gameObject.GetComponent<Canvas>();
     if (!IsPointerOverUIObject() && !battle)
     {
         /* if (Input.touchCount > 0)
          * {
          *   if (Input.GetTouch(0).phase == TouchPhase.Began)
          *   {
          *       PointerEventData ped = new PointerEventData(null);
          *       ped.position = Input.GetTouch(0).position;
          *       List<RaycastResult> results = new List<RaycastResult>();
          *       GR.Raycast(ped, results);
          *       if (results.Count == 0)
          *       {
          *               PlayerScript.saveStats();
          *               DestroyObject(this);
          *               Application.LoadLevel("Demo_Scene");
          *       }
          *   }
          * } */
         PlayerScript.saveStats();
         DestroyObject(this);
         Application.LoadLevel("Demo_Scene");
     }
 }