IEnumerator CreateBlueprint() { yield return(StartCoroutine(UploadImage())); ApiAvatar apiAvatar = ScriptableObject.CreateInstance <ApiAvatar>(); apiAvatar.Init( pipelineManager.user, blueprintName.text, cloudFrontImageUrl, cloudFrontAssetUrl, blueprintDescription.text, BuildTags(), cloudFrontUnityPackageUrl ); bool doneUploading = false; apiAvatar.Save(delegate(ApiModel model) { ApiAvatar savedBP = (ApiAvatar)model; pipelineManager.blueprintId = savedBP.id; pipelineManager.assetBundleUnityVersion = Application.unityVersion; UnityEditor.EditorPrefs.SetString("blueprintID-" + pipelineManager.GetInstanceID().ToString(), savedBP.id); doneUploading = true; }); while (!doneUploading) { yield return(null); } }
IEnumerator CreateBlueprint() { yield return(StartCoroutine(UploadImage())); SetUploadProgress("Saving Blueprint to user", "Almost finished!!", 0.0f); ApiWorld world = ScriptableObject.CreateInstance <ApiWorld>(); world.Init( pipelineManager.user, blueprintName.text, cloudFrontImageUrl, cloudFrontAssetUrl, blueprintDescription.text, (releasePublic.isOn) ? ("public") : ("private"), System.Convert.ToInt16(worldCapacity.text), BuildTags(), 0, cloudFrontPluginUrl, cloudFrontUnityPackageUrl ); if (APIUser.CurrentUser.developerType == APIUser.DeveloperType.Internal) { world.isCurated = contentFeatured.isOn || contentSDKExample.isOn; } else { world.isCurated = false; } bool doneUploading = false; world.SaveAndAddToUser(delegate(ApiModel model) { ApiWorld savedBP = (ApiWorld)model; pipelineManager.blueprintId = savedBP.id; pipelineManager.assetBundleUnityVersion = Application.unityVersion; UnityEditor.EditorPrefs.SetString("blueprintID-" + pipelineManager.GetInstanceID().ToString(), savedBP.id); Debug.Log("Setting blueprintID on pipeline manager and editor prefs"); doneUploading = true; }); while (!doneUploading) { yield return(null); } }