static void TranslateTutorialWelcomePage(TutorialWelcomePage welcomePg) { int numNewTranslations = TranslateObject(welcomePg); foreach (var button in welcomePg.Buttons) { numNewTranslations += TranslateObject(button); } if (numNewTranslations > 0) { welcomePg.RaiseModified(); } }
static TutorialWelcomePage CreateTutorialWelcomePage(string assetPath) { var asset = ScriptableObject.CreateInstance <TutorialWelcomePage>(); asset.m_WindowTitle = "Window Title"; asset.m_Title = "This Is the Title"; asset.m_Description = "This is the description."; asset.m_Buttons = new[] { TutorialWelcomePage.CreateCloseButton(asset) }; if (assetPath == null) { CreateAssetAndStartRenaming("New Tutorial Welcome Page.asset", asset); return(null); } else { CreateAsset(assetPath, asset); } return(asset); }
static (TutorialWelcomePage, TutorialContainer, TutorialProjectSettings) CreateReadyToUseTutorialProject() { var path = GetActiveFolderPath(); TutorialWelcomePage welcomePage = CreateTutorialWelcomePage($"{path}/Tutorial Welcome Page.asset"); TutorialContainer container = CreateTutorialContainer($"{path}/Tutorials.asset"); container.Title = "Title"; container.Subtitle = "Subtitle"; CreateTutorialFlow(null, container); TutorialProjectSettings tutorialProjectSettings = CreateTutorialProjectSettings($"{path}/Tutorial Project Settings.asset"); var style = tutorialProjectSettings.TutorialStyle; //this triggers the loading of the default style tutorialProjectSettings.WelcomePage = welcomePage; EnsureAssetChangesAreSaved(container); return(welcomePage, container, tutorialProjectSettings); }