Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
 public void Init()
 {
     gameObject.SetActive(false);
     IsOpen = false;
     //
     EventTool.Run(EventName.PanelBase.InitFinsh + gameObject.name);
 }
Esempio n. 4
0
 static void Execute()
 {
     if (!EditorApplication.isPlaying)
     {
         EditorApplication.isPlaying = true;
     }
     EventTool.AddEditorScript("GrowPointEditorScript");
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public void Close()
 {
     StopAllCoroutines();
     StartCoroutine(playExitAni(() =>
     {
         gameObject.SetActive(false);
         IsOpen = false;
         EventTool.Run(EventName.PanelBase.CloseFinsh + gameObject.name);
     }));
 }
Esempio n. 7
0
    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());
    }
Esempio n. 8
0
 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);
     }));
 }
Esempio n. 9
0
 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));
 }
Esempio n. 10
0
    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");
        }
    }
Esempio n. 11
0
    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);
    }
Esempio n. 12
0
 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));
 }
Esempio n. 13
0
 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();
 }
Esempio n. 14
0
 public override void Init()
 {
     EventTool.Add <string>(EventName.Audio.PlayBG, playBG);
     EventTool.Add <string>(EventName.Audio.PlayOnly, playBG);
 }
Esempio n. 15
0
 public static void Init()
 {
     EventTool.Add <byte[]>(EventName.SocketClient.ReceiveData, receivData);
 }
Esempio n. 16
0
 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);
 }
Esempio n. 17
0
 private void appInitFinsh()
 {
     EventTool.Run <string>(EventName.PanelBase.Open, PanelBaseName.ManorUI);
 }
Esempio n. 18
0
 void Start()
 {
     EventTool.TryAddEventCallback(trigger, EventTriggerType.PointerClick, OnPointerClick);
 }