Exemplo n.º 1
0
        protected override IEnumerator CreateBlueprint()
        {
            yield return(StartCoroutine(UpdateImage(isUpdate ? worldRecord.imageUrl : "", GetFriendlyWorldFileName("Image"))));

            SetUploadProgress("Saving Blueprint to user", "Almost finished!!", 0.0f);
            ApiWorld world = new ApiWorld();

            world.Init(
                pipelineManager.user,
                blueprintName.text,
                cloudFrontImageUrl,
                cloudFrontAssetUrl,
                blueprintDescription.text,
                (releasePublic.isOn) ? ("public") : ("private"),
                System.Convert.ToInt16(worldCapacity.text),
                BuildTags(),
                0,
                cloudFrontPluginUrl,
                cloudFrontUnityPackageUrl
                );
            world.id = pipelineManager.blueprintId;

            if (APIUser.CurrentUser.developerType > APIUser.DeveloperType.None)
            {
                world.isCurated = contentFeatured.isOn || contentSDKExample.isOn;
            }
            else
            {
                world.isCurated = false;
            }

            bool doneUploading = false;

            world.SaveAndAddToUser(false,
                                   delegate(ApiModel model)
            {
                ApiWorld savedBP = (ApiWorld)model;
                // pipelineManager.blueprintId = savedBP.id;
                UnityEditor.EditorPrefs.SetString("blueprintID-" + pipelineManager.GetInstanceID().ToString(), savedBP.id);
                Debug.Log("Setting blueprintID on pipeline manager and editor prefs");
                AnalyticsSDK.WorldUploaded(model, false);
                doneUploading = true;
            },
                                   delegate(string error)
            {
                Debug.LogError(error);
                doneUploading = true;
            });

            while (!doneUploading)
            {
                yield return(null);
            }
        }
Exemplo n.º 2
0
        protected override IEnumerator UpdateBlueprint()
        {
            bool doneUploading = false;

            worldRecord.name            = blueprintName.text;
            worldRecord.description     = blueprintDescription.text;
            worldRecord.capacity        = System.Convert.ToInt16(worldCapacity.text);
            worldRecord.assetUrl        = cloudFrontAssetUrl;
            worldRecord.pluginUrl       = cloudFrontPluginUrl;
            worldRecord.tags            = BuildTags();
            worldRecord.releaseStatus   = (releasePublic.isOn) ? ("public") : ("private");
            worldRecord.unityPackageUrl = cloudFrontUnityPackageUrl;
            worldRecord.UpdateVersionAndPlatform();
            worldRecord.isCurated = contentFeatured.isOn || contentSDKExample.isOn;

            if (shouldUpdateImageToggle.isOn)
            {
                yield return(StartCoroutine(UpdateImage(isUpdate ? worldRecord.imageUrl : "", GetFriendlyWorldFileName("Image"))));

                worldRecord.imageUrl = cloudFrontImageUrl;
                SetUploadProgress("Saving Blueprint", "Almost finished!!", 0.0f);
                worldRecord.Save(true, delegate(ApiModel model)
                {
                    AnalyticsSDK.WorldUploaded(model, true);
                    doneUploading = true;
                });
            }
            else
            {
                SetUploadProgress("Saving Blueprint", "Almost finished!!", 0.0f);
                worldRecord.Save(true, delegate(ApiModel model)
                {
                    AnalyticsSDK.WorldUploaded(model, true);
                    doneUploading = true;
                });
            }

            while (!doneUploading)
            {
                yield return(null);
            }
        }