void Start() { PublisherState currentStep = PublisherUtils.GetCurrentPublisherState(PublisherWindow.FindInstance()); Debug.Log(currentStep); switch (currentStep) { case PublisherState.Idle: //your code here break; case PublisherState.Login: //your code here break; case PublisherState.Zip: //your code here break; case PublisherState.Upload: //your code here break; case PublisherState.Process: //your code here break; default: break; } }
/// <summary> /// Initializes and returns an instance of AppState /// </summary> /// <param name="title"></param> /// <param name="buildOutputDir"></param> /// <param name="buildGUID"></param> /// <param name="zipPath"></param> /// <param name="step"></param> /// <param name="errorMsg"></param> /// <param name="key"></param> /// <param name="url"></param> public AppState( string title = null, string buildOutputDir = null, string buildGUID = null, string zipPath = null, PublisherState 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; }
public void AddMultiLevelWildcard() { // Arrange var topicBuilder = Fixture.Create <TopicBuilder>(); var subscriberState = new PublisherState(topicBuilder); // Act Action addingMultiLevelWildcard = () => subscriberState.AddMultiLevelWildcard(); // Assert addingMultiLevelWildcard.Should() .Throw <IllegalStateOperationException>( "because adding a wildcard is not allowed when publishing"); }
public void AddSingleLevelWildcard() { // Arrange var topicBuilder = Fixture.Create <TopicBuilder>(); var subscriberState = new PublisherState(topicBuilder); // Act Action addingMultiLevelWildcard = () => subscriberState.AddSingleLevelWildcard(); // Assert addingMultiLevelWildcard.Should() .Throw <MqttBaseException>( "because adding a topic should not be allowed on subscribe"); }
public void AddTopic() { // Arrange var topicBuilder = Fixture.Create <TopicBuilder>(); var subscriberState = new PublisherState(topicBuilder); var topic = TestUtils.GenerateSingleValidTopic(); // Act Action addingMultiLevelWildcard = () => subscriberState.AddTopic(topic); // Assert addingMultiLevelWildcard.Should() .NotThrow <MqttBaseException>( "because adding a topic should be allowed on subscribe"); }
void Update() { if (IsWaitingForLocalizationToBeReady) { return; } if (currentState != Store.state.step) { string token = UnityConnectSession.instance.GetAccessToken(); if (token.Length != 0) { currentState = Store.state.step; return; } Store.Dispatch(new NotLoginAction()); } RebuildFrontend(); }
void SetupBackend() { AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload; currentState = Store.state.step; CurrentTab = string.Empty; previousTab = string.Empty; UpdateWebGLInstalledFlag(); tabFrontendSetupMethods = new Dictionary <string, Action> { { TabIntroduction, SetupIntroductionTab }, { TabNotLoggedIn, SetupNotLoggedInTab }, { TabInstallWebGL, SetupInstallWebGLTab }, { TabNoBuild, SetupNoBuildTab }, { TabSuccess, SetupSuccessTab }, { TabError, SetupErrorTab }, { TabUploading, SetupUploadingTab }, { TabProcessing, SetupProcessingTab }, { TabUpload, SetupUploadTab } }; }
public void Save() { bool needSave = false; if (SortMainId > 0) { var o = SortMainObject.GetSortMain(SortMainId); if (o != null) { if (PublisherName?.Trim() != o.PublisherName) { o.PublisherName = PublisherName?.Trim(); needSave = true; } if (PublisherCity?.Trim() != o.PublisherCity) { o.PublisherCity = PublisherCity?.Trim(); needSave = true; } if (PublisherState?.Trim() != o.PublisherState) { o.PublisherState = PublisherState?.Trim(); needSave = true; } if (PublisherCountry != o.PublisherCountry) { o.PublisherCountry = PublisherCountry; needSave = true; } if (needSave) { o.Save(); } } } }
public void AddTopics() { // Arrange var topicBuilder = Fixture.Create <TopicBuilder>(); var subscriberState = new PublisherState(topicBuilder); var count = Fixture.Create <int>() % Mqtt.Topic.MaximumAllowedLevels; var topics = new Queue <string>(); for (var i = 0; i < count; ++i) { topics.Enqueue(TestUtils.GenerateSingleValidTopic()); } // Act Action addingMultiLevelWildcard = () => subscriberState.AddTopics(topics); // Assert addingMultiLevelWildcard.Should() .NotThrow <MqttBaseException>( "because adding a topic should be allowed on subscribe"); }
void RebuildFrontend() { if (!string.IsNullOrEmpty(Store.state.errorMsg)) { LoadTab(TabError); return; } if (openedForTheFirstTime) { LoadTab(TabIntroduction); return; } if (currentState != Store.state.step) { currentState = Store.state.step; } bool loggedOut = (currentState == PublisherState.Login); if (loggedOut) { LoadTab(TabNotLoggedIn); return; } if (!webGLIsInstalled) { UpdateWebGLInstalledFlag(); LoadTab(TabInstallWebGL); return; } if (!PublisherUtils.ValidBuildExists()) { LoadTab(TabNoBuild); return; } if (!string.IsNullOrEmpty(Store.state.url)) { LoadTab(TabSuccess); return; } if (currentState == PublisherState.Upload) { LoadTab(TabUploading); return; } if (currentState == PublisherState.Process) { LoadTab(TabProcessing); return; } LoadTab(TabUpload); }