예제 #1
0
        private static void GetTutorial(string lessonId, Action <List <TutorialProgressStatus> > action)
        {
            var userId = UnityConnectProxy.GetUserId();

            if (userId.IsNullOrEmpty())
            {
                if (!HasWarnedAboutLogin)
                {
                    Debug.LogWarning("Error: No user ID. Are you logged in?");
                    HasWarnedAboutLogin = true;
                }
                return;
            }
            var getLink = @"/v1/users/" + userId + @"/lessons";
            var address = HostAddress + getLink;
            var req     = MakeGetLessonsRequest(address, lessonId);

            SendWebRequest(req, (UnityWebRequest r) =>
            {
                if (!IsRequestSuccess(r))
                {
                    return;
                }
                var lessonResponses = TutorialProgressStatus.ParseResponses(r.downloadHandler.text);
                action(lessonResponses);
            });
        }
예제 #2
0
        private static void GetTutorial(string lessonId, Action <List <TutorialProgressStatus> > action)
        {
            var userId  = UnityConnectProxy.GetUserId();
            var getLink = @"/v1/users/" + userId + @"/lessons";
            var address = HostAddress + getLink;
            var req     = MakeGetLessonsRequest(address, lessonId);

            SendWebRequest(req, (UnityWebRequest r) =>
            {
                if (!IsRequestSuccess(r))
                {
                    return;
                }
                var lessonResponses = TutorialProgressStatus.ParseResponses(r.downloadHandler.text);
                action(lessonResponses);
            });
        }