示例#1
0
        public void SetUp()
        {
            m_Tutorial = ScriptableObject.CreateInstance <Tutorial>();

            m_Tutorial.m_Pages = new Tutorial.TutorialPageCollection(
                new[] { ScriptableObject.CreateInstance <TutorialPage>(), ScriptableObject.CreateInstance <TutorialPage>() }
                );
            for (int i = 0; i < m_Tutorial.m_Pages.count; ++i)
            {
                m_Tutorial.m_Pages[i].name       = string.Format("{0}-PAGE-{1}", TestContext.CurrentContext.Test.FullName, i + 1);
                m_Tutorial.m_Pages[i].DoneButton = doneButtonText;
                m_Tutorial.m_Pages[i].NextButton = nextButtonText;
            }

            var paragraph = new TutorialParagraph
            {
                m_Type     = ParagraphType.Instruction,
                m_Criteria = new TypedCriterionCollection(
                    new[]
                {
                    new TypedCriterion(new SerializedType(typeof(MockCriterion)), ScriptableObject.CreateInstance <MockCriterion>())
                }
                    )
            };

            paragraph.Title = firstPageInstructionSummary;
            paragraph.Text  = firstPageInstructionText;
            m_Tutorial.m_Pages[0].m_Paragraphs = new TutorialParagraphCollection(new[] { paragraph });

            m_Window = EditorWindow.GetWindow <TutorialWindow>();
            TutorialWindow.ShowTutorialsClosedDialog.SetValue(false);
            m_Window.SetTutorial(m_Tutorial, reload: false);
        }
示例#2
0
 private void StartTutorial()
 {
     Current.Instance.TutorialStarted = true;
     tutorialWindow         = new TutorialWindow();
     tutorialWindow.Closed += tutorialWindow_Closed;
     tutorialWindow.Show();
 }
示例#3
0
        public override void OnInspectorGUI()
        {
            TutorialProjectSettings.DrawDefaultAssetRestoreWarning();

            if (GUILayout.Button(Localization.Tr(MenuItems.ShowTutorials)))
            {
                // Make sure we will display 'this' container in the window.
                var window = Target.ProjectLayout != null
                    ? TutorialWindow.GetOrCreateWindowAndLoadLayout(Target)
                    : TutorialWindow.GetOrCreateWindowNextToInspector();

                window.ActiveContainer = Target;
            }

            EditorGUILayout.Space(10);

            if (SerializedTypeDrawer.UseDefaultEditors)
            {
                base.OnInspectorGUI();
            }
            else
            {
                serializedObject.Update();
                DrawPropertiesExcluding(serializedObject, k_PropertiesToHide);
                serializedObject.ApplyModifiedProperties();
            }
        }
示例#4
0
 public void StartBtnOnClick()
 {
     GameManager.ResumeGameStatic();
     GameManager.StartGame();
     TutorialWindow.ShowStatic();
     Time.timeScale = 0.0f;
     instance.Hide();
 }
示例#5
0
        private void TutorialButton_Click(object sender, RoutedEventArgs e)
        {
            SoundManager.PlayClickSound();

            var tutorialWindow = new TutorialWindow();

            tutorialWindow.Show();
        }
示例#6
0
 public void SetUp()
 {
     Reset();
     m_Window = EditorWindow.GetWindow <TutorialWindow>();
     m_Window.showTabClosedDialog = false;
     m_Window.rootVisualElement.style.flexDirection = FlexDirection.Row;
     m_Window.rootVisualElement.style.flexWrap      = Wrap.Wrap;
 }
示例#7
0
 private void TutorialButtonClick(object sender, RoutedEventArgs e)
 {
     Window childWindow = new TutorialWindow();
     childWindow.ShowInTaskbar = false;
     childWindow.Owner = Application.Current.MainWindow;
     childWindow.DataContext = this.DataContext;
     childWindow.Show();
 }
示例#8
0
 public void StartBtnOnClick()
 {
     GameManager.ResumeGameStatic();
     GameManager.StartGame();
     TutorialWindow.ShowStatic();
     playerCtrl.StartFirstExplosion();
     instance.Hide();
 }
示例#9
0
 public void Start()
 {
     startGameWindow         = UIManager.Instance.GetWindow <StartGameWindow>();
     settingsWindow          = UIManager.Instance.GetWindow <SettingsWindow>();
     tutorialWindow          = UIManager.Instance.GetWindow <TutorialWindow>();
     startGameWindow.OnOpen += ChangeCurrentWindow;
     settingsWindow.OnOpen  += ChangeCurrentWindow;
     tutorialWindow.OnOpen  += ChangeCurrentWindow;
 }
示例#10
0
 public static void Introduction()
 {
     //TryActivateTutorial(introductionDef, OpportunityType.Important);
     if (!PrisonLaborPrefs.HasTutorialFlag(TutorialFlag.Introduction))
     {
         TutorialWindow.Show("Introduction");
         PrisonLaborPrefs.AddTutorialFlag(TutorialFlag.Introduction);
         PrisonLaborPrefs.Save();
     }
 }
示例#11
0
    void Gray()
    {
        WhiteCam.active = BlackCam.active = true;
        SelectionWindow.SetActiveRecursively(false);
        gameState          = GameState.PlayGame;
        currentPlayMode    = CurrentPlayMode.Grey;
        time               = Time.timeSinceLevelLoad;
        CharWRender.active = CharBRender.active = true;

        TutorialWindow.SetActiveRecursively(true);
    }
示例#12
0
 void White()
 {
     WhiteCam.active = BlackCam.active = false;
     MainCam.active  = true;
     ActivateBlackMode(false);
     ActivateWhiteMode(true);
     SelectionWindow.SetActiveRecursively(false);
     gameState = GameState.PlayGame;
     GameManager.currentPlayMode = CurrentPlayMode.White;
     time = Time.timeSinceLevelLoad;
     CharWRender.active = true;
     CharBRender.active = false;
     TutorialWindow.SetActiveRecursively(true);
 }
示例#13
0
        private static void RunTutorial(string contentPath, Lifetime lifetime, ISolution solution, IPsiFiles psiFiles,
                                        TextControlManager textControlManager, IShellLocks shellLocks, IEditorManager editorManager,
                                        DocumentManager documentManager, IUIApplication environment, IActionManager actionManager,
                                        ToolWindowManager toolWindowManager, TutorialWindowDescriptor tutorialWindowDescriptor,
                                        IWindowsHookManager windowsHookManager, IPsiServices psiServices, IActionShortcuts shortcutManager,
                                        IColorThemeManager colorThemeManager)
        {
            var tutorialWindow = new TutorialWindow(contentPath, lifetime, solution, psiFiles, textControlManager, shellLocks, editorManager,
                                                    documentManager, environment, actionManager, toolWindowManager, tutorialWindowDescriptor, windowsHookManager,
                                                    psiServices, shortcutManager, colorThemeManager);

            lifetime.AddBracket(
                () => { tutorialWindow.Show(); },
                () => { tutorialWindow.Close(); });
        }
示例#14
0
 void Replay()
 {
     gameState = GameState.PlayGame;
     time      = Time.timeSinceLevelLoad;
     Character.SetActiveRecursively(true);
     GameOverWindow.SetActiveRecursively(false);
     TutorialWindow.SetActiveRecursively(true);
     if (currentPlayMode == CurrentPlayMode.Black)
     {
         CharWRender.active = false;
     }
     if (currentPlayMode == CurrentPlayMode.White)
     {
         CharBRender.active = false;
     }
 }
示例#15
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            if (tutorialWindow == null)
            {
                tutorialWindow = GameObject.FindGameObjectWithTag("TutorialWindow").GetComponent <TutorialWindow>();
            }

            if (pressedE == null)
            {
                pressedE = tutorialWindow.pressE;
            }

            GameRoot.ShowTips("Press \"E\" to select", true, false);
            Text.SetActive(true);
        }
    }
        public override void OnInspectorGUI()
        {
            if (GUILayout.Button(Localization.Tr(MenuItems.ShowTutorials)))
            {
                // Make sure we will display 'this' container in the window.
                var window = Target.ProjectLayout != null
                    ? TutorialWindow.CreateWindowAndLoadLayout(Target)
                    : TutorialWindow.CreateNextToInspector();

                window.ActiveContainer = Target;
            }

            if (k_IsAuthoringMode)
            {
                EditorGUILayout.Space(10);
                DrawPropertiesExcluding(serializedObject, k_PropertiesToHide);
                serializedObject.ApplyModifiedProperties();
            }
        }
示例#17
0
        /// <summary>
        /// Shows Tutorials window using the currently specified behaviour.
        /// </summary>
        /// <remarks>
        /// Different behaviors:
        /// 1. If a single root tutorial container (TutorialContainer.ParentContainer is null) that has Project Layout specified exists,
        ///    the window is loaded and shown using the specified project window layout (old behaviour).
        ///    If the project layout does not contain Tutorials window, the window is shown an as a free-floating window.
        /// 2. If no root tutorial containers exist, or a root container's Project Layout is not specified, the window is shown
        ///     by anchoring and docking it next to the Inspector (new behaviour). If the Inspector is not available,
        ///     the window is shown an as a free-floating window.
        /// 3. If there is more than one root tutorial container with different Project Layout setting in the project,
        ///    one asset is chosen randomly to specify the behavior.
        /// 4. If Tutorials window is already created, it is simply brought to the foreground and focused.
        /// </remarks>
        /// <returns>The the created, or aleady existing, window instance.</returns>
        public static TutorialWindow ShowTutorialWindow()
        {
            var rootContainers = TutorialEditorUtils.FindAssets <TutorialContainer>()
                                 .Where(container => container.ParentContainer is null);
            var defaultContainer = rootContainers.FirstOrDefault();
            var projectLayout    = defaultContainer?.ProjectLayout;

            if (rootContainers.Any(container => container.ProjectLayout != projectLayout))
            {
                Debug.LogWarningFormat(
                    "There is more than one TutorialContainers asset with different Project Layout setting in the project. " +
                    "Using asset at path {0} for the window behavior settings.",
                    AssetDatabase.GetAssetPath(defaultContainer)
                    );
            }

            TutorialWindow window = null;

            if (!rootContainers.Any() || defaultContainer.ProjectLayout == null)
            {
                window = TutorialWindow.GetOrCreateWindowNextToInspector();
            }
            else if (defaultContainer.ProjectLayout != null)
            {
                window = TutorialWindow.GetOrCreateWindowAndLoadLayout(defaultContainer);
            }

            // If we have more than one root container, we show a selection view. Exactly one (or zero) container
            // is set active immediately without possibility to return to the the selection view.
            if (rootContainers.Count() > 1)
            {
                window.SetContainers(rootContainers);
            }
            else
            {
                window.ActiveContainer = defaultContainer;
            }

            return(window);
        }
示例#18
0
        void tutorialMenuWindow_Closed(object sender, EventArgs e)
        {
            var tutorialMenuWindow = sender as TutorialMenuWindow;

            if (tutorialMenuWindow != null && !string.IsNullOrEmpty(tutorialMenuWindow.SelectedOption))
            {
                if (tutorialMenuWindow.SelectedOption.Equals("Button2"))
                {
                    Current.Instance.Tutorial2Started = true;
                    tutorialWindow         = new TutorialWindow();
                    tutorialWindow.Closed += tutorialWindow_Closed;
                    tutorialWindow.Show();
                }

                if (tutorialMenuWindow.SelectedOption.Equals("Button3"))
                {
                    TutorialGameWindow gameWindow = new TutorialGameWindow();
                    gameWindow.Closed += gameWindow_Closed;
                    gameWindow.Show();
                }
            }
        }
示例#19
0
    void Awake()
    {
        BlackMat.color = new Color(BlackMat.color.r, BlackMat.color.g, BlackMat.color.b, 1f);
        WhiteMat.color = new Color(WhiteMat.color.r, WhiteMat.color.g, WhiteMat.color.b, 1f);
        gameState      = GameState.OpeningWindow;
        OpeningWindow.SetActiveRecursively(true);
        GameOverWindow.SetActiveRecursively(false);
        SelectionWindow.SetActiveRecursively(false);
        TutorialWindow.SetActiveRecursively(false);


        BlackCam.camera.rect = new Rect(0.5f, 0, 0.5f, 1);
        WhiteCam.camera.rect = new Rect(0, 0, 0.5f, 1);

        MainCam.camera.rect = new Rect(0, 0, 1, 1);
        MainCam.active      = true;
        BlackCam.active     = WhiteCam.active = false;
        //fb = fbsuccess.GetComponent<UILabel>();

        deathLbl.text = "You died: @ time(s)!";
        timeLbl.text  = "Your max time: @";

        //White();
    }
        /// <summary>
        /// Shows Tutorials window using the currently specified behaviour.
        /// </summary>
        /// <remarks>
        /// Different behaviors:
        /// 1. If a single TutorialContainer asset that has TutorialContainer.ProjectLayout specified exists,
        ///    the window is loaded and shown using the specified project window layout (old behaviour).
        ///    If the project layout does not contain Tutorials window, the window is shown an as free-floating window.
        /// 2. If no TutorialContainer assets exist, or TutorialContainer.ProjectLayout is not specified, the window is shown
        ///     by anchoring and docking it next to the Inspector (new behaviour). If the Inspector is not available,
        ///     the window is shown an as free-floating window.
        /// 3. If there is more than one TutorialContainer asset with different Project Layout setting in the project,
        ///    one asset is chosen randomly to specify the behavior.
        /// 4. If Tutorials window is already created, it is simply brought to the foreground and focused.
        /// </remarks>
        /// <returns>The the created, or aleady existing, window instance.</returns>
        public static TutorialWindow ShowTutorialWindow()
        {
            var containers       = TutorialEditorUtils.FindAssets <TutorialContainer>();
            var defaultContainer = containers.FirstOrDefault();
            var projectLayout    = defaultContainer?.ProjectLayout;

            if (containers.Any(container => container.ProjectLayout != projectLayout))
            {
                Debug.LogWarningFormat(
                    "There is more than one TutorialContainers asset with different Project Layout setting in the project. " +
                    "Using asset at path {0} for the window behavior settings.",
                    AssetDatabase.GetAssetPath(defaultContainer)
                    );
            }

            TutorialWindow window = null;

            if (!containers.Any() || defaultContainer.ProjectLayout == null)
            {
                window = TutorialWindow.CreateNextToInspector();
            }
            else if (defaultContainer.ProjectLayout != null)
            {
                window = TutorialWindow.CreateWindowAndLoadLayout(defaultContainer);
            }

            window.SetContainers(containers);

            // If we have only one tutorial container, we set it active immediately
            if (containers.Count() == 1)
            {
                window.ActiveContainer = defaultContainer;
            }

            return(window);
        }
示例#21
0
    void GameOver()
    {
        deaths++;
        float timer = Time.timeSinceLevelLoad - time;

        if (timer > maxTime)
        {
            maxTime = timer;
        }
        string minutes = Mathf.Floor(maxTime / 60).ToString("00");
        string seconds = (maxTime % 60).ToString("00");

        gameState = GameState.GameOver;
        OpeningWindow.SetActiveRecursively(false);
        GameOverWindow.SetActiveRecursively(true);

        /* (fb.color == Color.red)
         *  fbpost.SetActiveRecursively(false);*/
        deathLbl.text = "You died: @ time(s)!";
        timeLbl.text  = "Your max time: @";
        deathLbl.text = deathLbl.text.Replace("@", deaths.ToString());
        timeLbl.text  = timeLbl.text.Replace("@", minutes + " minutes " + seconds + " seconds");
        TutorialWindow.SetActiveRecursively(false);
    }
        private void Tutorial_Button_Click(object sender, RoutedEventArgs e)
        {
            TutorialWindow tutorialWindow = new TutorialWindow((sender as Button).Name);

            tutorialWindow.ShowDialog();
        }
示例#23
0
        private void OnShowTutorialRequested(object obj)
        {
            var tutorialWindow = new TutorialWindow();

            tutorialWindow.ShowDialog();
        }
示例#24
0
 IEnumerator OnStartState()
 {
     yield return new WaitForSeconds(1.0f);
     this.startAnimation.Play();
     yield return new WaitForSeconds(3.4f);
     StartCoroutine(this.PlayMainMusic());
     if (this.currentLevel < this.tutorialPages.Length) {
         this.state = GameState.Tutorial;
         string prefix = "UI/tutorial/tutorial" + this.currentLevel.ToString() + "_";
         this.tutorialWindow = new TutorialWindow(prefix, this.tutorialPages[this.currentLevel], new Rect((Screen.width - 960) / 2.0f, (Screen.height - 720) / 2.0f, 960, 720));
     } else {
         this.state = GameState.Main;
         this.SetCharacterCanMove(true);
     }
 }
示例#25
0
 private void Awake()
 {
     instance = this;
     Hide();
 }
 // TODO not working as intented, doesn't show the Readme. Fix.
 //[MenuItem(TutorialWindowMenuItem.MenuPath + TutorialWindowMenuItem.Item + " (No Layout Change)")]
 static void OpenTutorialWindow()
 {
     TutorialWindow.GetOrCreateWindow();
 }
示例#27
0
        private static void TutorialExecute()
        {
            var tutorialWindow = new TutorialWindow();

            tutorialWindow.Show();
        }
示例#28
0
        private void StartTutorialCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var t = new TutorialWindow();

            t.ShowDialog();
        }