private void receiveData() { try { socket.BeginReceive(buffer, m_BufferSize, m_BufferLength - m_BufferSize, SocketFlags.None, new AsyncCallback((ar) => { try { Socket handler = (Socket)ar.AsyncState; int rLength = handler.EndReceive(ar); if (rLength > 0) { byte[] rData = unPackHead(); EventTool.Run <byte[]>(EventName.SocketClient.ReceiveData, rData); } receiveData(); } catch (Exception e) { socket = null; Debug.LogError("[ServerMng.receiveData]信息接受失败:" + e); } }), socket); } catch (Exception e) { socket = null; Debug.LogError("[ServerMng.receiveData]信息接受失败:" + e); } }
private int m_BufferSize = 0; //数组的实际占用的长度 public override void Init() { SocketUnPack.Init(); EventTool.Add <byte[]>(EventName.SocketClient.Send, send); EventTool.Add <string, int>(EventName.SocketClient.ConnectServer, connectServer); EventTool.Add(EventName.SocketClient.CloseConnect, closeConnect); }
public void Init() { gameObject.SetActive(false); IsOpen = false; // EventTool.Run(EventName.PanelBase.InitFinsh + gameObject.name); }
static void Execute() { if (!EditorApplication.isPlaying) { EditorApplication.isPlaying = true; } EventTool.AddEditorScript("GrowPointEditorScript"); }
public override void Init() { EventTool.Add <string>(EventName.PanelBase.Init, initPanelBase); EventTool.Add <string>(EventName.PanelBase.Open, (panelBaseName) => { openPanelBase(panelBaseName, null); }); EventTool.Add <string>(EventName.PanelBase.Close, (panelBaseName) => { closePanelBase(panelBaseName, null); }); EventTool.Add <string, PanelBaseEnterAni[]>(EventName.PanelBase.Open2, openPanelBase); EventTool.Add <string, PanelBaseExitAni[]>(EventName.PanelBase.Close2, closePanelBase); }
public void Close() { StopAllCoroutines(); StartCoroutine(playExitAni(() => { gameObject.SetActive(false); IsOpen = false; EventTool.Run(EventName.PanelBase.CloseFinsh + gameObject.name); })); }
public override void Init() { EventTool.Add <PhPRequestData>(EventName.HttpServerMng.AddRequest, onAddRequest); EventTool.Add <string>(EventName.HttpServerMng.RemoveRequest, onRemoveRequest); EventTool.Add <PhPRequestData>(EventName.HttpServerMng.RequestOnly, onRequestOnly); EventTool.Add <string>(EventName.Loginl.LoginSuccess, onLoginSuccess); base.Init(); StartCoroutine(request()); }
public void Open() { StopAllCoroutines(); transform.localScale = Vector3.one; transform.localPosition = Vector3.zero; GetComponent <CanvasGroup>().alpha = 1; gameObject.SetActive(true); IsOpen = true; StartCoroutine(playEnterAni(() => { EventTool.Run(EventName.PanelBase.OpenFinsh + gameObject.name); })); }
public void Close(PanelBaseExitAni[] _exitAni = null) { if (_exitAni == null && exitAni != null) { _exitAni = exitAni; } IsOpen = false; EventTool.Run(EventName.PanelBase.Close + gameObject.name); StopAllCoroutines(); StartCoroutine(playExitAni(() => { gameObject.SetActive(false); EventTool.Run(EventName.PanelBase.CloseFinsh + gameObject.name); }, _exitAni)); }
void onUploadReccordFileComplete(IGCloudVoice.GCloudVoiceCompleteCode code, string filepath, string fileid) { if (code == IGCloudVoice.GCloudVoiceCompleteCode.GV_ON_UPLOAD_RECORD_DONE) { Debug.Log("OnUploadReccordFileComplete succ, filepath:" + filepath + " fileid len=" + fileid.Length + " fileid:" + fileid + " fileid len=" + fileid.Length); XLua.LuaTable tab = AppMng.luaEnv.NewTable(); tab.Set <string, string> ("fileid", fileid); EventTool.Run("niuniu", "playroom.sendchat", tab); } else { Debug.Log("OnUploadReccordFileComplete error"); } }
public void Restart() { CorMng.Instance.Clear(); HttpSerMng.Instance.Clear(); EventTool.Clear(); PanelTool.Clear(); AudioMng.Instance.Init(); PanelTool.InitPanel("hall", "systempop", 1); PanelTool.InitPanel("hall", "loading", 1); PanelTool.InitPanel("hall", "toast", 1); LuaTable logindata = luaEnv.NewTable(); PanelTool.OpenPanel("hall", "login", 0, logindata); }
public void Open(PanelBaseEnterAni[] _enterAni = null) { if (_enterAni == null && enterAni != null) { _enterAni = enterAni; } gameObject.SetActive(true); IsOpen = true; EventTool.Run(EventName.PanelBase.Open + gameObject.name); StopAllCoroutines(); transform.localScale = Vector3.one; transform.localPosition = Vector3.zero; GetComponent <CanvasGroup>().alpha = 1; StartCoroutine(playEnterAni(() => { EventTool.Run(EventName.PanelBase.OpenFinsh + gameObject.name); }, _enterAni)); }
public override void Init() { EventTool.Add("hall", "setting.audioVal", "AudioMng", (_tab) => { audioVal = _tab.Get <float>("val"); clickAS.volume = audioVal; }); EventTool.Add("hall", "setting.musicVal", "AudioMng", (_tab) => { musicVal = _tab.Get <float>("val"); bgAS.volume = musicVal; }); if (PlayerPrefs.HasKey("hall.config")) { Hashtable config = MiniJSON.jsonDecode(PlayerPrefs.GetString("hall.config")) as Hashtable; audioVal = float.Parse((config ["hall"] as Hashtable) ["audioVal"].ToString()); musicVal = float.Parse((config ["hall"] as Hashtable) ["musicVal"].ToString()); } bgAS.volume = musicVal; base.Init(); }
public override void Init() { EventTool.Add <string>(EventName.Audio.PlayBG, playBG); EventTool.Add <string>(EventName.Audio.PlayOnly, playBG); }
public static void Init() { EventTool.Add <byte[]>(EventName.SocketClient.ReceiveData, receivData); }
public override void Init() { EventTool.Add <PanelBaseName>(EventName.PanelBase.Init, initPanelBase); EventTool.Add <PanelBaseName>(EventName.PanelBase.Open, openPanelBase); EventTool.Add <PanelBaseName>(EventName.PanelBase.Close, closePanelBase); }
private void appInitFinsh() { EventTool.Run <string>(EventName.PanelBase.Open, PanelBaseName.ManorUI); }
void Start() { EventTool.TryAddEventCallback(trigger, EventTriggerType.PointerClick, OnPointerClick); }