void RebuildFrontend()
        {
            if (currentShareStep != store.state.shareState.step)
            {
                currentShareStep = store.state.shareState.step;
            }

            bool loggedOut = (currentShareStep == ShareStep.Login);

            if (loggedOut)
            {
                LoadTab(TAB_NOT_LOGGED_IN);
                return;
            }

            bool buildIsUnavailable = !SharePackageUtils.LastBuildIsValid();

            if (buildIsUnavailable)
            {
                LoadTab(TAB_NO_BUILD);
                return;
            }

            string projectUrl = store.state.shareState.url;

            if (!string.IsNullOrEmpty(projectUrl))
            {
                LoadTab(TAB_SUCCESS);
                return;
            }

            string errorMsg = store.state.shareState.errorMsg;

            if (!string.IsNullOrEmpty(errorMsg))
            {
                LoadTab(TAB_ERROR);
                return;
            }

            if (currentShareStep == ShareStep.Upload)
            {
                LoadTab(TAB_UPLOADING);
                return;
            }

            if (currentShareStep == ShareStep.Process)
            {
                LoadTab(TAB_PROCESSING);
                return;
            }

            LoadTab(TAB_UPLOAD);
        }
Ejemplo n.º 2
0
 public ShareState(string title   = null, string buildOutputDir = null, string buildGUID   = null,
                   string zipPath = null, ShareStep step        = default, string errorMsg = null,
                   string key     = null, string url = null)
 {
     this.title          = title;
     this.buildOutputDir = buildOutputDir;
     this.buildGUID      = buildGUID;
     this.zipPath        = zipPath;
     this.step           = step;
     this.errorMsg       = errorMsg;
     this.url            = url;
     this.key            = key;
 }
 void Update()
 {
     if (currentShareStep != Store.state.step)
     {
         string token = UnityConnectSession.instance.GetAccessToken();
         if (token.Length != 0)
         {
             currentShareStep = Store.state.step;
             return;
         }
         Store.Dispatch(new NotLoginAction());
     }
     RebuildFrontend();
 }
Ejemplo n.º 4
0
 public ShareState(string title   = null, string buildOutputDir = null,
                   string zipPath = null, ShareStep step        = default, string errorMsg = null,
                   string key     = null, int progress          = 0, string url = null, string thumbnailDir = null)
 {
     this.title          = title;
     this.buildOutputDir = buildOutputDir;
     this.zipPath        = zipPath;
     this.step           = step;
     this.errorMsg       = errorMsg;
     this.progress       = progress;
     this.url            = url;
     this.key            = key;
     this.thumbnailDir   = thumbnailDir;
 }
 void Update()
 {
     if (currentShareStep != store.state.shareState.step)
     {
         string token = UnityConnectSession.instance.GetAccessToken();
         if (token.Length != 0)
         {
             //Debug.LogErrorFormat("State went from {0} to {1}, rebuilding frontend", currentShareStep, store.state.shareState.step);
             currentShareStep = store.state.shareState.step;
             return;
         }
         store.Dispatch(new NotLoginAction());
     }
     RebuildFrontend();
 }
        void SetupBackend()
        {
            AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload;
            currentShareStep = store.state.shareState.step;
            currentTab       = string.Empty;
            previousTab      = string.Empty;

            tabFrontendSetupMethods = new Dictionary <string, Action>();
            tabFrontendSetupMethods.Add(TAB_NOT_LOGGED_IN, SetupNotLoggedInTab);
            tabFrontendSetupMethods.Add(TAB_NO_BUILD, SetupNoBuildTab);
            tabFrontendSetupMethods.Add(TAB_SUCCESS, SetupSuccessTab);
            tabFrontendSetupMethods.Add(TAB_ERROR, SetupErrorTab);
            tabFrontendSetupMethods.Add(TAB_UPLOADING, SetupUploadingTab);
            tabFrontendSetupMethods.Add(TAB_PROCESSING, SetupProcessingTab);
            tabFrontendSetupMethods.Add(TAB_UPLOAD, SetupUploadTab);
        }
        void SetupBackend()
        {
            AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload;
            currentShareStep = Store.state.step;
            currentTab       = string.Empty;
            previousTab      = string.Empty;
            UpdateWebGLInstalledFlag();

            tabFrontendSetupMethods = new Dictionary <string, Action>
            {
                { TAB_INTRODUCTION, SetupIntroductionTab },
                { TAB_NOT_LOGGED_IN, SetupNotLoggedInTab },
                { TAB_INSTALL_WEBGL, SetupInstallWebGLTab },
                { TAB_NO_BUILD, SetupNoBuildTab },
                { TAB_SUCCESS, SetupSuccessTab },
                { TAB_ERROR, SetupErrorTab },
                { TAB_UPLOADING, SetupUploadingTab },
                { TAB_PROCESSING, SetupProcessingTab },
                { TAB_UPLOAD, SetupUploadTab }
            };
        }
        void RebuildFrontend()
        {
            if (!string.IsNullOrEmpty(Store.state.errorMsg))
            {
                LoadTab(TAB_ERROR);
                return;
            }

            if (openedForTheFirstTime.value)
            {
                LoadTab(TAB_INTRODUCTION);
                return;
            }

            if (currentShareStep != Store.state.step)
            {
                currentShareStep = Store.state.step;
            }

            bool loggedOut = (currentShareStep == ShareStep.Login);

            if (loggedOut)
            {
                LoadTab(TAB_NOT_LOGGED_IN);
                return;
            }

            if (!webGLIsInstalled)
            {
                UpdateWebGLInstalledFlag();
                LoadTab(TAB_INSTALL_WEBGL);
                return;
            }

            if (!ShareUtils.ValidBuildExists())
            {
                LoadTab(TAB_NO_BUILD);
                return;
            }

            if (!string.IsNullOrEmpty(Store.state.url))
            {
                LoadTab(TAB_SUCCESS);
                return;
            }


            if (currentShareStep == ShareStep.Upload)
            {
                LoadTab(TAB_UPLOADING);
                return;
            }

            if (currentShareStep == ShareStep.Process)
            {
                LoadTab(TAB_PROCESSING);
                return;
            }

            LoadTab(TAB_UPLOAD);
        }