using System.Collections; using System.Collections.Generic; using UnityEngine; using EduCoderTool; namespace DisComputer { /* *@func iframe 通讯 *@author lz *@data 2020/06/09 * */ public class IframeSokecter : MonoBehaviour { private string recieveStr; // Start is called before the first frame update void Start() { WebConnecter.Singleton.startHandle += OnRecStart; WebConnecter.Singleton.pauseHandle += OnRecPause; WebConnecter.Singleton.unPauseHandle += OnRecUnPause; WebConnecter.Singleton.finishHandle += OnRecFinish; } private void OnGUI() { /*GUIStyle gUIStyle = new GUIStyle(); gUIStyle.fontSize = 20; gUIStyle.normal.textColor = Color.green; GUI.Label(new Rect(50, 0, 300, 50), recieveStr, gUIStyle);*/ } void OnRecStart() { MainControl.Instance.SetGameState(MainState.Active); } void OnRecPause() { } void OnRecUnPause() { } void OnRecFinish() { MainControl.Instance.SetGameState(MainState.Idle); } void OnRecData(string data) { recieveStr = data; } } }