Exemplo n.º 1
0
 public CInteractionMgr GetInteractionMgr()
 {
     if (!m_InteractionMgr)
     {
         m_InteractionMgr = GameObject.Find("/Canvas/myScenePanel").GetComponent <CInteractionMgr>();
     }
     return(m_InteractionMgr);
 }
Exemplo n.º 2
0
    //========================================

    // Use this for initialization
    void Start()
    {
        socketindex = -1;

        Debug.Log(string.Format("======Start==={0}", socketindex));
        m_InteractionMgr = null;
        m_GameCtr        = null;

        m_myPlayer = CPlayer.Instance();

        m_GameTable = CTable.Instance();

        OnConnectCall = OnConnectCallFunc;

        j = MsgInit();


        if (j != 0)
        {
            return;
        }
        Debug.Log("=====msgmanager--=-==-");

        ///注册消息,iso注意此消息
        foreach (msg_id item in Enum.GetValues(typeof(msg_id)))
        {
            RegMsg((int)item, OnConnectCall);
        }

        ///注册连接成功消息
        //RegMsg((int)msg_id.ID_CONNECTION_REQUEST_ACCEPTED, OnConnectCall);

        //RegMsg((int)msg_id.PT_USER_INGAME_MSG, OnConnectCall);

        //RegMsg(141, OnConnectCall);
        Debug.Log("=====msgmanager-1-=-==-");


        int ret = Connect("192.168.1.110", 61000, "", 0);

        // int ret = Connect("35.196.108.73", 61000, "", 0);
        //   int ret = Connect("192.168.247.251", 61000, "", 0);

        i = ret;

        return;
    }