Пример #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);

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(50, 200, 200, 30), "SendFriendRequest"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.SendFriendRequest(userName, buddyName, message, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(260, 200, 200, 30), "GetFriendRequest"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.GetFriendRequest(buddyName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(470, 200, 200, 30), "AcceptFriendRequest"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.AcceptFriendRequest(buddyName, userName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(680, 200, 200, 30), "RejectFriendRequest"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.RejectFriendRequest(buddyName, userName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(890, 200, 200, 30), "GetAllFriends"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.GetAllFriends(userName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(50, 250, 200, 30), "CreateGroupByUser"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.CreateGroupByUser(userName, groupName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(260, 250, 200, 30), "AddFriendToGroup"))
        {
            IList <string> friendList = new List <string>();
            friendList.Add("Akshay");
            friendList.Add("Neena");
            friendList.Add("Zin");
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.AddFriendToGroup(userName, groupName, friendList, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(470, 250, 200, 30), "BlockUser"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.BlockUser(userName, buddyName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(680, 250, 200, 30), "UnblockUser"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.UnblockUser(userName, buddyName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(890, 250, 200, 30), "BlockFriendRequest"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.BlockFriendRequest(userName, buddyName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(50, 300, 200, 30), "GetAllGroups"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.GetAllGroups(userName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(260, 300, 200, 30), "GetAllFriendsInGroup"))
        {
            buddyService = sp.BuildBuddyService();                    // Initializing BuddyService.
            buddyService.GetAllFriendsInGroup(userName, ownerName, groupName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(470, 300, 200, 30), "CheckedInGeoLocation"))
        {
            GeoPoint gp = new GeoPoint();
            gp.SetLng(28.409195800000000000);
            gp.SetLat(77.047811200000070000);
            gp.SetMarker("Himalya");
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.CheckedInGeoLocation(userName, gp, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(680, 300, 200, 30), "GetFriendsByLocation"))
        {
            double latitude  = 77.047811200000070000;
            double longitude = 28.409195800000000000;
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.GetFriendsByLocation(userName, latitude, longitude, maxDistance, 5, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(890, 300, 200, 30), "SendMessageToGroup"))
        {
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.SendMessageToGroup(userName, ownerName, groupName, message, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(50, 350, 200, 30), "SendMessageToFriend"))
        {
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.SendMessageToFriend(userName, buddyName, message, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(260, 350, 200, 30), "SendMessageToFriends"))
        {
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.SendMessageToFriends(userName, message, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(470, 350, 200, 30), "GetAllMessages"))
        {
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.GetAllMessages(userName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(680, 350, 200, 30), "GetAllMessagesFromBuddy"))
        {
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.GetAllMessagesFromBuddy(userName, buddyName, callback);
        }

        //=======================================BUDDY_SERVICE================================================

        if (GUI.Button(new Rect(890, 350, 200, 30), "GetAllMessagesFromGroup"))
        {
            buddyService = sp.BuildBuddyService();            // Initializing BuddyService.
            buddyService.GetAllMessagesFromGroup(userName, ownerName, groupName, callback);
        }
    }