Beispiel #1
0
        new void Start()
        {
            if (!Application.isEditor || !Application.isPlaying)
            {
                return;
            }

            base.Start();

            IsCurrentWorldInCommunityLabs   = false;
            IsCurrentWorldUploaded          = false;
            IsCurrentWorldPubliclyPublished = false;


            var desc = pipelineManager.GetComponent <VRC.SDKBase.VRC_SceneDescriptor>();

            desc.PositionPortraitCamera(imageCapture.shotCamera.transform);

            Application.runInBackground       = true;
            UnityEngine.XR.XRSettings.enabled = false;

            uploadButton.onClick.AddListener(SetupUpload);

            openCommunityLabsDocsButton.onClick.AddListener(OpenCommunityLabsDocumentation);

            shouldUpdateImageToggle.onValueChanged.AddListener(ToggleUpdateImage);

            releasePublic.gameObject.SetActive(false);

            System.Action <string> onError = (err) => {
                VRC.Core.Logger.LogError("Could not authenticate - " + err, DebugLevel.Always);
                blueprintPanel.SetActive(false);
                errorPanel.SetActive(true);
            };

            if (!ApiCredentials.Load())
            {
                onError("Not logged in");
            }
            else
            {
                APIUser.InitialFetchCurrentUser(
                    delegate(ApiModelContainer <APIUser> c)
                {
                    UserLoggedInCallback(c.Model as APIUser);
                },
                    delegate(ApiModelContainer <APIUser> c)
                {
                    onError(c.Error);
                }
                    );
            }

#if !COMMUNITY_LABS_SDK
            publishToCommunityLabsPanel.gameObject.SetActive(false);
#endif
        }
Beispiel #2
0
        void Login()
        {
            if (!ApiCredentials.Load())
            {
                LoginErrorCallback("Not logged in");
            }
            else
            {
                APIUser.InitialFetchCurrentUser(
                    delegate(ApiModelContainer <APIUser> c)
                {
                    pipelineManager.user = c.Model as APIUser;

                    ApiAvatar av = new ApiAvatar()
                    {
                        id = pipelineManager.blueprintId
                    };
                    av.Get(false,
                           (c2) =>
                    {
                        VRC.Core.Logger.Log("<color=magenta>Updating an existing avatar.</color>", DebugLevel.API);
                        apiAvatar = c2.Model as ApiAvatar;
                        pipelineManager.completedSDKPipeline = !string.IsNullOrEmpty(apiAvatar.authorId);
                        SetupUI();
                    },
                           (c2) =>
                    {
                        VRC.Core.Logger.Log("<color=magenta>Creating a new avatar.</color>", DebugLevel.API);
                        apiAvatar    = new ApiAvatar();
                        apiAvatar.id = pipelineManager.blueprintId;
                        pipelineManager.completedSDKPipeline = !string.IsNullOrEmpty(apiAvatar.authorId);
                        SetupUI();
                    });
                }, (c) => {
                    LoginErrorCallback(c.Error);
                });
            }
        }
Beispiel #3
0
    public static void InitAccount()
    {
        if (isInitialized)
        {
            return;
        }

        if (!APIUser.IsLoggedIn && ApiCredentials.Load())
        {
            APIUser.InitialFetchCurrentUser((c) => AnalyticsSDK.LoggedInUserChanged(c.Model as APIUser), null);
        }

        clientInstallPath = SDKClientUtilities.GetSavedVRCInstallPath();
        if (string.IsNullOrEmpty(clientInstallPath))
        {
            clientInstallPath = SDKClientUtilities.LoadRegistryVRCInstallPath();
        }

        signingIn     = false;
        isInitialized = true;

        ClearContent();
    }