Ejemplo n.º 1
0
    void Start()
    {
        httpNetwork                  = HttpNetManager.Instance;
        httpNetwork.requestURL       = "http://dev-soul.shinezoneapp.com/?&*=[{0}]"; //请求地址
        httpNetwork.requestParams    = "[\"{0}\",[{1}]]";                            //参数组装
        httpNetwork.userID           = "77";                                         //用户id
        httpNetwork.waitResponseTime = 3;
        httpNetwork.resetSendMax     = 2;

        httpNetwork.RegisterResponse("game.login", ResponseHandler); //单个接口的侦听
        httpNetwork.serverErrorResponse = ServerErrorHandler;
        httpNetwork.netTimeOut          = NetTimeOutHandler;         //网络超时

        httpNetwork.Post("game.login", ResponseHandler);             //单一侦听,报了系统级别错误不会有回调
        httpNetwork.Post("game.login", ResponseHandler);
        httpNetwork.Post("game.reset", ResponseHandler);
        httpNetwork.Post("cityOrder.list", ResponseHandler);
        httpNetwork.Post("game.login", ResponseHandler);


        httpNetwork.PostOneToOne("game.login");
        httpNetwork.PostOneToOne("game.login", PostOneToOneHandler);
        httpNetwork.PostOneToOne("game.login", "Http://test.com/&*={0}");
        httpNetwork.PostOneToOne("game.login", "Http://test.com/&*={0}", PostOneToOneHandler);
    }
Ejemplo n.º 2
0
    public void InitManagers()
    {
        this.gameObject.AddComponent <NotDestoryGo>();

        if (canvasRootManager == null)
        {
            GameObject UICanvas = GameObject.Find("UICanvas");
            if (UICanvas != null)
            {
                canvasRootManager = UICanvas.AddComponent <CanvasRootManager>();
                UICanvas.AddComponent <NotDestoryGo>();
            }
        }
        if (httpNetManager == null)
        {
            httpNetManager = this.gameObject.AddComponent <HttpNetManager>();
        }
        if (webSocketNetManager == null)
        {
            webSocketNetManager = this.gameObject.AddComponent <WebSocketNetManager>();
        }
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     instance = this;
     InitHttpClient();
 }