IEnumerator TestUnload() { ZLog.D(this, "start coroutine"); yield return(new WaitForSeconds(_waitSenconds)); this.DoUnload(); }
void ClickCall(object[] args) { string req = _component.iptFight.text; _download.AddPostData(_url, Encoding.UTF8.GetBytes(req), OnDownloadOk); ZLog.D(this, "click button req {0}", req); }
// Use this for initialization void Start() { //if (Debug.isDebugBuild) // Debug.Log("This is a debug build!"); ZLog.D(this, "hello"); ZLog.D(this, "hello message"); CnUIMgr.Instance.LoadPanelShow <SimplePanel>("panel"); }
public LuaWebSocket(LuaTable sp) { ZLog.D(null, "in LuaWebSocket"); Init(this, LuaMain.Ins); LuaMain.Ins.quitDl += OnQuit; scriptEnv = sp; Register(); }
// Use this for initialization void Start() { ZLog.D(this, "start socket order {0}", this.ZOrder); _component._btn1.transform.Find("Text").GetComponent <Text>().text = "connect"; SetClickEventOnce(_component._btn1, ClickBtnConnet, new object[] { "cnt" }); _component._btn2.transform.Find("Text").GetComponent <Text>().text = "disconnect"; SetClickEventOnce(_component._btn2, ClickDisconnet, new object[] { "dis" }); _component._btn3.transform.Find("Text").GetComponent <Text>().text = "ping"; SetClickEventOnce(_component._btn3, ClickBtnSendPing, new object[] { "ping" }); _component._text.text = "init"; _ws = new ZbyWebSocket(this, this); }
// Use this for initialization void Start() { ZLog.D(this, "start socket order {0}", this.ZOrder); _component._btn1.transform.Find("Text").GetComponent <Text>().text = "connect"; SetClickEventOnce(_component._btn1, ClickBtnConnet, new object[] { "cnt" }); _component._btn2.transform.Find("Text").GetComponent <Text>().text = "disconnect"; SetClickEventOnce(_component._btn2, ClickDisconnet, new object[] { "dis" }); _component._text.text = "init"; _socket = new Chat_Socket(this); _socket.ChatEvent += OnRecvChat; _socket.ConnectEvent += OnConnetEvent; _socket.DisEvent += OnDisconnectEvent; }
bool HandleMsg(P32M32Header header, byte[] body, int handleCount) { ByteBuffer bb = new ByteBuffer(body); switch (header.cmd) { case 3: { string name = bb.ReadString(); string content = bb.ReadString(); string show = string.Format("recv [{0}]:{1}", name, content); ZLog.D(null, show); if (null != ChatEvent) { ChatEvent(show); } break; } } return(true); }
// Start is called before the first frame update void Start() { ZLog.D(this, "start"); StringBuilder sb = new StringBuilder(); sb.AppendFormat("absoluteURL:{0}\n", Application.absoluteURL); sb.AppendFormat("dataPath:{0}\n", Application.dataPath); sb.AppendFormat("consoleLogPath:{0}\n", Application.consoleLogPath); sb.AppendFormat("persistentDataPath:{0}\n", Application.persistentDataPath); sb.AppendFormat("streamingAssetsPath:{0}\n", Application.streamingAssetsPath); sb.AppendFormat("temporaryCachePath:{0}\n", Application.temporaryCachePath); sb.AppendFormat("UserDocumentPath:{0}\n", OSTools.GetUserDocumentPath()); _component.iptFight.text = sb.ToString(); Text txt = _component.btnSend.GetComponentInChildren <Text>(); txt.text = "加载配置"; SetClickEventOnce(_component.btnSend, ClickCall, null); //_component.btnSend.Text = "hello"; }
void ClickBtnConnet(object[] args) { //ZLog.D(this, "click connect args {0}", args[0]); string luazip = Application.streamingAssetsPath + "/core.zip"; using (ZipFile zip = new ZipFile(luazip)) { foreach (ZipEntry entry in zip) { //ZipFile zipFile = new ZipFile(zipFile.GetInputStream(entry)); ZLog.D(this, entry.Name); using (var stream = zip.GetInputStream(entry)) { byte[] buffer = new byte[entry.Size]; stream.Read(buffer, 0, buffer.Length); ZLog.D(this, "{0}", Encoding.UTF8.GetString(buffer)); break; // return true; } } } }
void ClickBtnConnet(object[] args) { ZLog.D(this, "click connect args {0}", args[0]); _ws.Open(_url);//"ws://localhost:8000/ws" }
void ClickDisconnet(object[] args) { ZLog.D(this, "click connect args {0}", args[0]); _socket.Close(); }
void ClickCall(object[] args) { ZLog.D(null, "click button"); this.DoUnload(); }
public override void OnLoad(params object[] args) { ZLog.D(null, "onload order {0}", this.ZOrder); SetClickEventOnce(_component._btn1, ClickCall, new object[] { "Call java" }); }
// public override void OnLoad(params object[] args) { _waitSenconds = (float)args[0]; ZLog.D(this, "onload order {0}", this.ZOrder); }
void ClickBtnSendPing(object[] args) { ZLog.D(this, "click connect args {0}", args[0]); //_ws.ping(); }
// Use this for initialization void Start() { ZLog.D(this, "start order {0}", this.ZOrder); this.StartCoroutine("TestUnload"); }
public override void OnLoad(params object[] args) { ZLog.D(this, "onload order {0}", this.ZOrder); }
public override void OnTop(CnPanelObj topview) //从后层变到顶层 { ZLog.D(this, "OnTop order {0}", this.ZOrder); }
void ClickCall(object[] args) { _method = _component.iptMethod.text; _param = _component.iptParam.text; ZLog.D(this, "click button method {0}({1})", _method, _param); }
public override bool OnUnload() { ZLog.D(this, "onunload order {0}", this.ZOrder); return(true); }
void OnDownloadOk(WWW www, DownloadData urlData) { ZLog.D(this, "recv {0}", Encoding.UTF8.GetString(www.bytes)); }
// Start is called before the first frame update void Start() { ZLog.D(this, "in start url {0}", _url); SetClickEventOnce(_component.btnSend, ClickCall, new object[] { "Call java" }); _download = this.gameObject.AddComponent <DownloadQueue>(); }
void ClickBtnConnet(object[] args) { ZLog.D(this, "click connect args {0}", args[0]); _socket.Connect(Host, Port); }
public override void OnLoad(params object[] args) { ZLog.D(this, "onload order {0} url {1}", this.ZOrder, args[0]); _url = args[0] as String; }
public override void OnLoad(params object[] args) { ZLog.D(this, "onload order {0} ip {1}:{2}", this.ZOrder, args[0], args[1]); Host = args[0] as String; Port = (int)args[1]; }
void Awake() { ZLog.D(this, "awake"); }
public override void OnBehind(CnPanelObj topview) //从顶层移到后一层 { ZLog.D(this, "OnBehind order {0}", this.ZOrder); }
// Start is called before the first frame update void Start() { ZLog.D(this, "in start url {0}", _url); SetClickEventOnce(_component.btnSend, ClickCall, new object[] { "Call java" }); _ws = new ZbyWebSocket(this, this); }
public override void OnLoad(params object[] args) { _url = args[0] as string; ZLog.D(this, "onload order {0}", this.ZOrder); }
// Use this for initialization void Start() { ZLog.D(this, "start order {0}", this.ZOrder); SetClickEventOnce(_component.btnCall, ClickCall, new object[] { "Call java" }); }