using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestFile : MonoBehaviour { public bool isInit; public Text backt; public Text backfinalt; public Text myt; public InputField inputField; void Start() { YiYanBack _setAndrodCallback = new YiYanBack(); UnityToJava.initSpeek(_setAndrodCallback); isInit = true; } private void OnApplicationPause(bool pause) { if(isInit) { if(pause) { UnityToJava.yiYanClass.CallStatic("onPauseJava"); } else { UnityToJava.yiYanClass.CallStatic("onResumeJava"); } } } public void StopSpeek() { UnityToJava.yiYanClass.CallStatic("StopSpeek"); } public void audio1() { UnityToJava.yiYanClass.CallStatic("next_audio"); } public void audio2() { UnityToJava.yiYanClass.CallStatic("previous_audio"); } public void audio3() { UnityToJava.yiYanClass.CallStatic("default_audio"); } public void StartSpeek() { UnityToJava.yiYanClass.CallStatic("StartSpeek"); } private void OnDestroy() { UnityToJava.yiYanClass.CallStatic("onDestroyJava"); } private void Update() { if (YiYanBack.BackTextlist.Count > 0) { backt.text = YiYanBack.BackTextlist.Dequeue(); } if (YiYanBack.BackFINALTextlist.Count > 0) { backfinalt.text = YiYanBack.BackFINALTextlist.Dequeue(); send(backfinalt.text); inputField.text = myt.text; } if (YiYanBack.MyTextlist.Count > 0) { myt.text = YiYanBack.MyTextlist.Dequeue(); inputField.text = myt.text; } } public void send(string str) { UnityToJava.yiYanClass.CallStatic("SendText",str); } public void sendText() { send(inputField.text); } }