void OnTriggerEnter(Collider col) { if (col.gameObject.CompareTag("target")) { EasyTTSUtil.SpeechAdd("Congratulations, you've reached your destination."); Debug.Log("Game Over, you've completed the course"); isAllowMove = false; isReachTarget = true; infoBrg.setReachTarget(isReachTarget); source.Stop(); mode++; resetTutorial(); } }
void Start() { EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates); gameController = gameObject.GetComponent <GameController1> (); Button yes = yesButton.GetComponent <Button> (); Button no = NoButton.GetComponent <Button> (); selection = 0; inforBrg = new TheInformationBridge(); inforBrg.setReachTarget(false); EasyTTSUtil.SpeechAdd("Do you want play again"); Debug.Log("DO you want play again?"); yes.onClick.AddListener(ClickYes); no.onClick.AddListener(ClickNo); }
/* * When avatar come into contact with a TRIGGER * such as the destination cube. * @param col - the trigger that was collided */ void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Door") { Debug.Log("Walking through room " + col.gameObject.name + " door"); EasyTTSUtil.SpeechAdd("Walking through room " + col.gameObject.name + " door"); } if (col.gameObject.CompareTag("target")) { endOfGame = true; nexDir = new NextDirection(); nexDir.setEndTime(timerText.text); nexDir.setNumOfCollisions(countColli); WriteString(); source.Stop(); EasyTTSUtil.SpeechAdd("Congratulations, you've reached your destination."); Debug.Log("Game Over, you've completed the course"); isAllowMove = false; isReachTarget = true; infoBrg.setReachTarget(isReachTarget); StartCoroutine(MyCoroutine(5)); //Application.Quit(); /****************************************** not for test * //Invoke("EndGame", 4); // Wait 4 seconds and then call the "changeToEndScene" Method. * * /////// Get UnityPlayerActivity class from Android Side //////////////// * using (AndroidJavaClass jc = new AndroidJavaClass("com.jastworld.interfaceplugin.UnityPlayerActivity")) * { * if (jc != null) * { * //jc.CallStatic("UnitySendMessage", "text", "setText", "Got UnityPlayerActivity Class!"); * //print("Got UnityPlayerActivity Class!"); * * /////// Get the instance of UnityPlayerActivity class from Android Side //////////////// * using (AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity")) * { * if (jo != null) * { * //jc.CallStatic("UnitySendMessage", "text", "setText", "Got UnityPlayerActivity Object!"); * //print("Got UnityPlayerActivity Object!"); * * //////// Call goToEnd() method in the instance of UnityPlayerActivity ///////// * jo.Call("EndScreen", timerText.text, (countColli+"")); * //jo.Call("goToEnd"); * } * else * { * //jc.CallStatic("UnitySendMessage", "text", "setText", "NOT Got UnityPlayerActivity Object!"); * print("NOT Got UnityPlayerActivity Object!"); * } * } * } * else * { * jc.CallStatic("UnitySendMessage", "text", "setText", "NOT Got UnityPlayerActivity Class!"); * print("NOT Got UnityPlayerActivity Class!"); * } * * }**********************************************/ } }