Esempio n. 1
0
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.getResult();
        }

        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1300, 175), success);


        //=======================================SESSION_SERVICE=======================================

        if (GUI.Button(new Rect(50, 200, 200, 30), "GetSession"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.GetSession(cons.userName, callBack);
        }

        //====================================SESSION_SERVICE==========================================

        if (GUI.Button(new Rect(260, 200, 200, 30), "GetSessionIsCreate"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.GetSession(cons.userName, cons.isCreate, callBack);
        }

        //====================================SESSION_SERVICE=========================================

        if (GUI.Button(new Rect(470, 200, 200, 30), "Invalidate"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.Invalidate(cons.sessionId, callBack);
        }

        //=====================================SESSION_SERVICE========================================

        if (GUI.Button(new Rect(680, 200, 200, 30), "SetAttribute"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.SetAttribute(cons.sessionId, cons.attributeName, cons.attributeValue, callBack);
        }

        //======================================SESSION_SERVICE=======================================

        if (GUI.Button(new Rect(890, 200, 200, 30), "GetAttribute"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.GetAttribute(cons.sessionId, cons.attributeName, callBack);
        }

        //======================================SESSION_SERVICE=======================================

        if (GUI.Button(new Rect(50, 250, 200, 30), "GetAllAttributes"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.GetAllAttributes(cons.sessionId, callBack);
        }

        //=======================================SESSION_SERVICE======================================

        if (GUI.Button(new Rect(260, 250, 200, 30), "RemoveAttribute"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.RemoveAttribute(cons.sessionId, cons.attributeName, callBack);
        }

        //========================================SESSION_SERVICE=====================================

        if (GUI.Button(new Rect(470, 250, 200, 30), "RemoveAllAttributes"))
        {
            sessionService = sp.BuildSessionService();                     // Initializing Session Service.
            sessionService.RemoveAllAttributes(cons.sessionId, callBack);
        }
    }