123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 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);
- }
-
-
- }
|