Example #1
0
    IEnumerator PlayEvent(TutorialEvent evnt)
    {
        isPlaying = true;
        float audio_length = 0f;

        if (evnt.sound_file)
        {
            this.sound_source.clip = evnt.sound_file;
            audio_length           = this.sound_source.clip.length;
            this.sound_source.Play();
        }
        int num_times_to_flash = evnt.times_to_flash;

        audio_length -= ((float)num_times_to_flash * FLASH_TIME);
        if (audio_length <= 0f)
        {
            audio_length = 5f;
        }
        for (int i = 0; i < num_times_to_flash; ++i)
        {
            foreach (E_Indicator cator in evnt.indicators)
            {
                Toggle_Indicator(cator);
            }
            yield return(new WaitForSeconds(FLASH_TIME));
        }
        Reset_Indicators();
        isPlaying = false;
        yield return(new WaitForSeconds(audio_length));
    }
Example #2
0
 IEnumerator DelayedUnpauseRoutine(float delay, TutorialEvent t)
 {
     yield return new WaitForSeconds(delay);
     paused = false;
     if (t != null) GameManager.Instance.ReportTutorialEventComplete(t);
     GameManager.Instance.tracker.CreateEventExt("PauseSimulation", paused.ToString());
 }
Example #3
0
 public void CreateTutorialPopup(TutorialEvent t, Vector3 position)
 {
     //two versions, depending on if we want to set the position at the same time as setting the pop up to open
     tutorialManager.tutorialOverlay.PrepareTutorialPopup(t.popupDescription, position);
     tutorialManager.tutorialOverlay.tutorialCloseButton.onClick.AddListener(() => tutorialManager.tutorialOverlay.ClosePanel());
     tutorialManager.tutorialOverlay.OpenPanel();
 }
Example #4
0
 public void CreateTutorialPopup(TutorialEvent t, GridObjectBehavior gridObject)
 {
     //two versions, depending on if we want to set the position at the same time as setting the pop up to open
     tutorialManager.tutorialOverlay.SetTooltip(t.popupDescription, gridObject.gameObject, t.nextTutorial);
     tutorialManager.tutorialOverlay.tutorialCloseButton.onClick.AddListener(() => tutorialManager.tutorialOverlay.ClosePanel());
     tutorialManager.tutorialOverlay.OpenPanel();
 }
    public void ReportTutorialEventSkip(bool allSubsequentForLevel)
    {
        GameManager.Instance.tracker.CreateEventExt("ReportTutorialEventSkip", "AllSubsequent=" + allSubsequentForLevel.ToString());

        if (allSubsequentForLevel)
        {
            if (tutorialEventIndex < currentTutorialEventQueue.Length)
            {
                CloseTutorial(currentTutorialEventQueue[tutorialEventIndex]);
            }
            foreach (TutorialEvent t in currentTutorialEventQueue)
            {
                t.hasCompleted = true;
            }
            tutorialEventIndex = currentTutorialEventQueue.Length;

            int levelIndex = GameManager.Instance.GetDataManager().currentLevelData.metadata.level_id;
            ForceTutorialSeriesCompletion(levelIndex);
        }
        else
        {
            if (tutorialEventIndex < currentTutorialEventQueue.Length)
            {
                TutorialEvent targetTutorial = currentTutorialEventQueue[tutorialEventIndex];
                ReportTutorialEventComplete(targetTutorial);
            }
        }
    }
    void PerformTutorial(TutorialEvent t)
    {
        //Debug.Log("Performing Tutorial Event");
        if (t.type == TutorialEvent.TutorialTypes.popup)
        {
            switch (t.complete_trigger)
            {
            case TutorialEvent.TutorialCompletionTriggers.clickButton:
            case TutorialEvent.TutorialCompletionTriggers.placeSignal:
            case TutorialEvent.TutorialCompletionTriggers.placeSemaphore:
                GameManager.Instance.tracker.CreateEventExt("PerformTutorial", t.popupDescription);
                tutorialOverlay.SetTooltip(t.popupDescription, t.targetButton, t.nextTutorial);
                tutorialOverlay.OpenPanel();
                t.ActivateTutorialEventListener();
                break;

            case TutorialEvent.TutorialCompletionTriggers.clickPopup:
                GameManager.Instance.tracker.CreateEventExt("PerformTutorial", t.popupDescription);
                if (t.targetComponentType.Length > 0)
                {
                    List <GridObjectBehavior> objectsOfType = GameManager.Instance.GetGridManager().GetGridComponentsOfType("signal");
                    if (objectsOfType.Count > 0)
                    {
                        tutorialOverlay.SetTooltip(t.popupDescription, objectsOfType[0].gameObject, t.nextTutorial);
                    }
                    else
                    {
                        tutorialOverlay.SetTooltip(t.popupDescription, t.targetButton, t.nextTutorial);
                    }
                }
                else
                {
                    tutorialOverlay.SetTooltip(t.popupDescription, t.targetButton, t.nextTutorial);
                }
                tutorialOverlay.SetTooltip(t.popupDescription, t.targetButton, t.nextTutorial);

                tutorialOverlay.OpenPanel();
                t.ActivateTutorialEventListener();
                break;

            case TutorialEvent.TutorialCompletionTriggers.simulationInteraction:
                GameManager.Instance.tracker.CreateEventExt("PerformTutorial", "simulationInteraction");
                t.ActivateTutorialEventListener();
                break;
            }
        }
        else if (t.type == TutorialEvent.TutorialTypes.video)
        {
        }
        else if (t.type == TutorialEvent.TutorialTypes.simulation)
        {
            PlayerInteraction_GamePhaseBehavior playerInteractionBehavior = (PlayerInteraction_GamePhaseBehavior)GameManager.Instance.playerInteractionBehavior;
            if (t.overrideSimulation == true)
            {
                playerInteractionBehavior.tutorialMode = true;
                GameManager.Instance.TriggerLoadTutorialLevel(t.filepath);
                t.ActivateTutorialEventListener();
            }
        }
    }
Example #7
0
    void CloseTutorial(TutorialEvent t)
    {
        if (t.type == TutorialEvent.TutorialTypes.popup)
        {
            switch (t.complete_trigger)
            {
            case TutorialEvent.TutorialCompletionTriggers.clickButton:
            case TutorialEvent.TutorialCompletionTriggers.clickPopup:
                tutorialOverlay.ClosePanel();
                GameManager.Instance.tracker.CreateEventExt("CloseTutorial", "clickPopup");
                break;

            case TutorialEvent.TutorialCompletionTriggers.placeSemaphore:
            case TutorialEvent.TutorialCompletionTriggers.placeSignal:
                tutorialOverlay.ClosePanel();
                GameManager.Instance.tracker.CreateEventExt("CloseTutorial", "placeDraggable");
                break;

            case TutorialEvent.TutorialCompletionTriggers.simulationInteraction:
                tutorialOverlay.ClosePanel();
                GameManager.Instance.tracker.CreateEventExt("CloseTutorial", "simulationInteraction");
                break;
            }
            t.hasCompleted = true;
        }
        else if (t.type == TutorialEvent.TutorialTypes.video)
        {
        }
        else if (t.type == TutorialEvent.TutorialTypes.simulation)
        {
            PlayerInteraction_GamePhaseBehavior playerInteractionBehavior = (PlayerInteraction_GamePhaseBehavior)GameManager.Instance.playerInteractionBehavior;
            t.hasCompleted = true;
        }
    }
Example #8
0
    private void Awake()
    {
        isPaused         = false;
        pauseEvent       = Pause;
        gameOverEvent    = GameOver;
        tutorialText     = TutorialText;
        getTutorialIndex = GetTutorialIndex;

        musicOn  = music.transform.GetChild(1).gameObject;
        musicOff = music.transform.GetChild(2).gameObject;
        soundOn  = sound.transform.GetChild(1).gameObject;
        soundOff = sound.transform.GetChild(2).gameObject;

        musicOn.SetActive(Utils.Music >= 0);
        musicOff.SetActive(Utils.Music < 0);
        soundOn.SetActive(Utils.Soundfx >= 0);
        soundOff.SetActive(Utils.Soundfx < 0);
        sensitivitySlider.value = Utils.Sensitivity;

        pause.onClick.AddListener(Pause);
        resume.onClick.AddListener(Pause);
        menu.onClick.AddListener(Menu);
        menu2.onClick.AddListener(Menu);
        again.onClick.AddListener(Again);
        sound.onClick.AddListener(ToggleSound);
        music.onClick.AddListener(ToggleMusic);
        sensitivitySlider.onValueChanged.AddListener(ChangeSensitivity);
        blur          = Camera.main.GetComponent <BlurOptimized>();
        tutorialTexts = tutorial.GetComponentsInChildren <FadeableUI>();
        tutorialIndex = 0;
    }
    private void HandleEvent(TutorialEvent tutorialEvent)
    {
        switch (tutorialEvent)
        {
        case TutorialEvent.NONE:
            break;

        case TutorialEvent.LOAD_PRESET_LEVEL:
            LevelSelectGUI.currentLevel = Levels.GetLevel(level);
            Loading.Load(level);
            break;

        case TutorialEvent.LOAD_NEXT_LEVEL:
            LoadLevel.LoadALevel("next");
            break;

        case TutorialEvent.START_PLAYER:
            tutorialEnabled = false;

            // Disable buttons
            lastButton.interactable = false;
            nextButton.interactable = false;
            skipButton.interactable = false;

            // Get rid of mainCamera tag
            //tag = "Untagged";

            // Unfreeze camera
            {
                //theCamera.active = true;
                theCamera.GetComponent <LevelStart>().Start();
            }

            // Unfreeze player
            GameObject player = GameObject.Find("Player");
            if (player != null)
            {
                player.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeRotation;
            }

            // Disable tutorial camera
            //gameObject.active = false;
            this.enabled = false;
            break;

        case TutorialEvent.PLAY_RECORDING:
            string       test = "Recordings/" + points[index].recordingName;
            TextAsset    ta   = (TextAsset)Resources.Load(test);
            Stream       s    = new MemoryStream(ta.bytes);
            BinaryReader br   = new BinaryReader(s);
            GameRecorder.StartPlaybackTutorial(Recording.Read(br));
            break;

        case TutorialEvent.RESET_PLAYER:
            GameRecorder.StopPlayback();
            GameObject.Find("Player").BroadcastMessage("Reload");
            break;
        }
    }
Example #10
0
 void Start()
 {
     createHero(trooper, 0, 3);
     createBasicEnemy(1);
     tutorialEvent = TutorialEvent.BASIC_MOVE;
     setBarrelsActive(false);
     enemyRepeateCounter = 0;
 }
Example #11
0
 public void SetTutorialPopupClickToClose(TutorialEvent t, bool shouldClickToClose)
 {
     tutorialManager.tutorialOverlay.tutorialCloseButton.onClick.RemoveAllListeners();
     tutorialManager.tutorialOverlay.tutorialCloseButton.enabled = shouldClickToClose;
     if (shouldClickToClose)
     {
         tutorialManager.tutorialOverlay.tutorialCloseButton.onClick.AddListener(() => t.TriggerTutorialEventListener());
     }
 }
Example #12
0
    void PerformTutorial(TutorialEvent t)
    {
        if (t.type == TutorialEvent.TutorialTypes.popup)
        {
            switch (t.complete_trigger)
            {
            case TutorialEvent.TutorialCompletionTriggers.clickButton:
            case TutorialEvent.TutorialCompletionTriggers.clickPopup:
            case TutorialEvent.TutorialCompletionTriggers.placeSignal:
            case TutorialEvent.TutorialCompletionTriggers.placeSemaphore:
                GameManager.Instance.tracker.CreateEventExt("PerformTutorial", t.popupDescription);
                Vector3 defaultPosition = new Vector3(Screen.width / 2, Screen.height / 2, 0);
                if (t.targetButton != null)
                {
                    defaultPosition = t.targetButton.transform.position;
                    if (defaultPosition.x > (Screen.width / 2))
                    {
                        defaultPosition.x -= t.targetButton.GetComponent <RectTransform>().rect.width / 2;
                    }
                    else
                    {
                        defaultPosition.x += t.targetButton.GetComponent <RectTransform>().rect.width / 2;
                    }
                    if (defaultPosition.y > (Screen.height / 2))
                    {
                        defaultPosition.x -= t.targetButton.GetComponent <RectTransform>().rect.height / 2;
                    }
                    else
                    {
                        defaultPosition.x += t.targetButton.GetComponent <RectTransform>().rect.height / 2;
                    }
                }
                tutorialOverlay.PrepareTutorialPopup(t.popupDescription, defaultPosition);
                tutorialOverlay.OpenPanel();
                t.ActivateTutorialEventListener();
                break;

            case TutorialEvent.TutorialCompletionTriggers.simulationInteraction:
                GameManager.Instance.tracker.CreateEventExt("PerformTutorial", "simulationInteraction");
                t.ActivateTutorialEventListener();
                break;
            }
        }
        else if (t.type == TutorialEvent.TutorialTypes.video)
        {
        }
        else if (t.type == TutorialEvent.TutorialTypes.simulation)
        {
            PlayerInteraction_GamePhaseBehavior playerInteractionBehavior = (PlayerInteraction_GamePhaseBehavior)GameManager.Instance.playerInteractionBehavior;
            if (t.overrideSimulation == true)
            {
                playerInteractionBehavior.tutorialMode = true;
                GameManager.Instance.TriggerLoadTutorialLevel(t.filepath);
                t.ActivateTutorialEventListener();
            }
        }
    }
Example #13
0
 public void DelayedUnpause(float delay = 0, TutorialEvent t = null)
 {
     //Debug.Log(delay);
     if (delay == 0)
     {
         paused = false;
         GameManager.Instance.tracker.CreateEventExt("PauseSimulation", paused.ToString());
     }
     else
     {
         StartCoroutine(DelayedUnpauseRoutine(delay, t));
     }
 }
Example #14
0
        void SetDiscription()
        {
            GameStatus.SetCurrentGameState(CurrentGameState.Dialog);
            var dialogEvent = GameManager.Instance.GetComponent <DialogEvent>();

            UserInterface.DialogSetActive(true);
            UserInterface.Instance.Dialog.SetDialog(dialogEvent.dialogs[1],
                                                    () => {
                GameStatus.SetCurrentGameState(CurrentGameState.Tutorial);
                currentTutorial = TutorialEvent.Three;
                Invoke("SetMoveAndDashEvent", 2f);
            });
        }
Example #15
0
 public void StartTutorial(TutorialEvent e)
 {
     SplitScreen();
     StartCoroutine(SceneUtility.LoadTutorial());
     EventBus.Publish <ResourceChangeEvent>(new ResourceChangeEvent(1, 5000));
     EventBus.Publish <ResourceChangeEvent>(new ResourceChangeEvent(2, 5000));
     EventBus.Publish <SpeedChangeEvent>(new SpeedChangeEvent(1, 50));
     EventBus.Publish <SpeedChangeEvent>(new SpeedChangeEvent(2, 50));
     finished           = false;
     chest_converted[1] = chest_converted[2] = false;
     goal_point[1]      = goal_point[2] = 0;
     isTutorial         = true;
 }
Example #16
0
        void MoveAndDashEventSupport()
        {
            GameStatus.SetCurrentGameState(CurrentGameState.Dialog);
            var dialogEvent = GameManager.Instance.GetComponent <DialogEvent>();

            PlayerFSMManager.Instance.isAttackOne = false;
            UserInterface.Instance.Dialog.SetDialog(dialogEvent.dialogs[3],
                                                    () =>
            {
                GameStatus.SetCurrentGameState(CurrentGameState.Tutorial);
                currentTutorial = TutorialEvent.Item;
                fences[0].OpenFence();
            });
        }
Example #17
0
        // Start is called before the first frame update
        protected override void Awake()
        {
            //base.Awake();

            currentTutorial = TutorialEvent.Start;

            MC.Sound.MCSoundManager.LoadBank();
            var sound = MCSoundManager.Instance.objectSound;

            StartCoroutine(MCSoundManager.AmbFadeIn(1f));
            StartCoroutine(MCSoundManager.BGMFadeIn(1f));
            MCSoundManager.ChangeBGM(sound.bgm.tutoBGM);
            MCSoundManager.ChangeAMB(sound.ambient.tutoAmbient);
        }
Example #18
0
 public void ReportTutorialEventComplete(TutorialEvent t)
 {
     CloseTutorial(t);
     tutorialEventIndex++;
     if (tutorialIndex < currentTutorialEventQueue.Length)
     {
         InitializeCurrentTutorialEvent();
     }
     else
     {
         Debug.Log("No more tutorials.");
         GameManager.Instance.tracker.CreateEventExt("ReportTutorialEventComplete", "NoMore");
     }
 }
Example #19
0
    /// <summary>
    /// @brief ポップアップの前のページ表示用
    /// </summary>
    /// <param name="tutorialEvent"></param>
    private void EventPrevPage(TutorialEvent tutorialEvent)
    {
        if (tutorialEvent.AnimationId < 0)
        {
            tutorialEvent.AnimationId = 0;
        }

        popup.SetButtonText(EButtonId.OK, "次へ");

        // 前のイベントを格納
        var prev = New(tutorialEvent.Animations[tutorialEvent.AnimationId]);

        prev.transform.SetParent(contentRoot.transform, false);
        Content = prev;
    }
 void RemoveTutorial(int index)
 {
     TutorialEvent[] newTutorialEvents = new TutorialEvent[tutorialEvents.Length - 1];
     for (int i = 0; i < newTutorialEvents.Length; i++)
     {
         if (i < index)
         {
             newTutorialEvents[i] = tutorialEvents[i];
         }
         else
         {
             newTutorialEvents[i] = tutorialEvents[i + 1];
         }
     }
     tutorialEvents = newTutorialEvents;
 }
Example #21
0
        void SetMoveAndDashEvent()
        {
            PlayerFSMManager.Instance.isInputLock = false;
            PlayerFSMManager.Instance.isAttackOne = false;
            GameStatus.SetCurrentGameState(CurrentGameState.Dialog);
            var dialogEvent = GameManager.Instance.GetComponent <DialogEvent>();

            UserInterface.DialogSetActive(true);
            UserInterface.Instance.Dialog.SetDialog(dialogEvent.dialogs[2],
                                                    () => {
                GameStatus.SetCurrentGameState(CurrentGameState.Tutorial);
                currentTutorial = TutorialEvent.MoveDash;
                tutorialUI.moveDash.gameObject.SetActive(true);
                GameManager.Instance.CharacterControl = true;
            });
        }
Example #22
0
        private void OnTutorialEvent(TutorialEvent e)
        {
            if (currentPhaseIndex >= phases.Length)
            {
                return;
            }

            if (!CurrentPhase.SetDuration && CurrentPhase.IsCorrectEvent(e))
            {
                if (!TryGoToNextPhase())
                {
                    return;
                }

                PreparePhase();
            }
        }
Example #23
0
    /// <summary>
    /// @brief 通常のページ用コールバック設定
    /// </summary>
    /// <param name="id">アイテムID</param>
    /// <param name="tutorialEvent">TutorialEvent.</param>
    private void DefaultPageCallback(EButtonId id, TutorialEvent tutorialEvent)
    {
        // 前のイベントを削除してきれいな状態にする
        contentRoot.SetActive(false);
        Delete(Content);

        switch (id)
        {
        // OKボタンの処理
        case EButtonId.OK:
            tutorialEvent.AnimationId += 1;

            // 次のイベントがなければポップアップを閉じる
            if (tutorialEvent.AnimationId > tutorialEvent.Animations.Count - 1)
            {
                popup.Close(() => { tutorialEvent.ExitEvent(); contentRoot.SetActive(false); });
                return;
            }

            // 次があるならOKボタンの設置
            if (tutorialEvent.AnimationId >= tutorialEvent.Animations.Count - 1)
            {
                popup.SetButtonText(EButtonId.OK, "OK");
            }

            var next = New(tutorialEvent.Animations[tutorialEvent.AnimationId]);
            next.transform.SetParent(contentRoot.transform, false);

            Content = next;

            break;

        // キャンセル(戻る)ボタンの処理
        case EButtonId.Cancel:

            // イベントの状態を1つ戻す
            tutorialEvent.AnimationId -= 1;
            EventPrevPage(tutorialEvent);

            break;
        }

        // 表示
        contentRoot.SetActive(true);
    }
Example #24
0
    /// <summary>
    /// @brief イベント設定用。ラムダ式での設定の為重複回避の為に関数分けを行う
    /// </summary>
    /// <param name="tutorialEvent"></param>
    private void StartEvent(TutorialEvent tutorialEvent)
    {
        tutorialEvent.EventCallback = id =>
        {
            popup.ButtonCallback      = buttonType => DefaultPageCallback(buttonType, tutorialEvent);
            tutorialEvent.AnimationId = 0;

            var first = New(tutorialEvent.Animations[tutorialEvent.AnimationId]); // 最初に表示させるイベントを格納
            first.transform.SetParent(contentRoot.transform, false);              // 重複して表示をさせないために表示をfalseにする
            Content         = first;
            popup.ButtonSet = EButtonSet.Set2;
            // ボタンのテキストを変更
            popup.SetButtonText(EButtonId.OK, "次へ");
            popup.SetButtonText(EButtonId.Cancel, "前へ");
            // ポップアップ表示と同時に最初のイベントも再生
            popup.Open(contentRoot.gameObject, tutorialEvent.BeginEvent);
        };
    }
Example #25
0
        void SetTutoEnd()
        {
            GameStatus.SetCurrentGameState(CurrentGameState.Dialog);
            var dialogEvent = GameManager.Instance.GetComponent <DialogEvent>();

            PlayerFSMManager.Instance.isAttackOne = false;
            fences[1].OpenFence();
            UserInterface.DialogSetActive(true);
            tutorialUI.moveDash.gameObject.SetActive(false);
            timelinecam.transform.position = Camera.main.transform.position;
            UserInterface.Instance.Dialog.SetDialog(dialogEvent.dialogs[4],
                                                    (() => {
                GameStatus.SetCurrentGameState(CurrentGameState.Tutorial);
                currentTutorial = TutorialEvent.Item;
                //tutorialUI.move.gameObject.SetActive(true);
                GameManager.Instance.CharacterControl = true;
            }));
        }
Example #26
0
        public void SetAttackEvent()
        {
            GameStatus.SetCurrentGameState(CurrentGameState.Dialog);
            var dialogEvent = GameManager.Instance.GetComponent <DialogEvent>();

            UserInterface.DialogSetActive(true);
            UserInterface.Instance.Dialog.SetDialog(dialogEvent.dialogs[8],
                                                    () => {
                GameStatus.SetCurrentGameState(CurrentGameState.Tutorial);
                currentTutorial = TutorialEvent.Attack;
                tutorialUI.attack.gameObject.SetActive(true);
                tutorialUI.attack.attack.gameObject.SetActive(true);
                tutorialUI.attack.attack.text = tutoText[0];
                //tutorialUI.move.gameObject.SetActive(true);
                StartCoroutine(SetSommonLocation(tutoWave[0].monsterTypes));
                GameManager.Instance.CharacterControl = true;
            });
        }
 void AddNewTutorial(int index)
 {
     TutorialEvent[] newTutorialEvents = new TutorialEvent[tutorialEvents.Length + 1];
     for (int i = 0; i < newTutorialEvents.Length; i++)
     {
         if (i < index)
         {
             newTutorialEvents[i] = tutorialEvents[i];
         }
         else if (i == index)
         {
             newTutorialEvents[i] = new TutorialEvent();
         }
         else
         {
             newTutorialEvents[i] = tutorialEvents[i - 1];
         }
     }
     tutorialEvents = newTutorialEvents;
 }
Example #28
0
    public static TutorialEvent CreateNewEvent(int triggerNodeIdx, float triggerTngOffset,
                                               int startNodeIdx, float startTngOffset)
    {
        if (_path == null)
        {
            throw new UnityException("Cannot find path");
        }
        GameObject obj = new GameObject();

        obj.name = "TutorialEvent";

        TutorialEvent tutorialEvent = obj.AddComponent <TutorialEvent>();

        tutorialEvent._triggerNodeIdx   = triggerNodeIdx;
        tutorialEvent._triggerTngOffset = triggerTngOffset;
        tutorialEvent._startNodeIdx     = startNodeIdx;
        tutorialEvent._startTngOffset   = startTngOffset;
        tutorialEvent._startBinrmOffset = 0f;

        obj.transform.position = Bezier.GetPoint3d(_path.Nodes[startNodeIdx]._ctrlPts, startTngOffset);

        Vector3 tng = Bezier.GetTangent3d(_path.Nodes[startNodeIdx]._ctrlPts, startTngOffset);

        tutorialEvent._chargingCanvas = Instantiate(_chargingCanvasPrefab,
                                                    obj.transform.position + Vector3.up * 2.5f, Quaternion.LookRotation(tng)) as Canvas;
        tutorialEvent._chargingCanvas.transform.parent = tutorialEvent.transform;
        tutorialEvent._chargingCanvas.gameObject.SetActive(false);

        tutorialEvent._inspirationCanvas = Instantiate(_inspirationCanvasPrefab,
                                                       obj.transform.position + Vector3.up * 2f, Quaternion.LookRotation(tng)) as Canvas;
        tutorialEvent._inspirationCanvas.transform.parent = tutorialEvent.transform;
        tutorialEvent._inspirationCanvas.gameObject.SetActive(false);

        tutorialEvent._reflectionCanvas = Instantiate(_reflectionCanvasPrefab,
                                                      obj.transform.position + Vector3.up * 2f, Quaternion.LookRotation(tng)) as Canvas;
        tutorialEvent._reflectionCanvas.transform.parent = tutorialEvent.transform;
        tutorialEvent._reflectionCanvas.gameObject.SetActive(false);

        return(tutorialEvent);
    }
Example #29
0
 void InitializeCurrentTutorialEvent()
 {
     if (tutorialEventIndex >= currentTutorialEventQueue.Length)
     {
         Debug.Log("All tutorials complete for this level.");
     }
     else
     {
         Debug.Log(tutorialIndex.ToString() + " is current Tutorial index.");
         TutorialEvent currentTutorial = currentTutorialEventQueue[tutorialEventIndex];
         PerformTutorial(currentTutorial);
         if (currentTutorialEventQueue.Length > tutorialEventIndex + 2) //is there a next tutorial?
         {
             TutorialEvent nextTutorial = currentTutorialEventQueue[tutorialEventIndex + 1];
             if (nextTutorial.type == TutorialEvent.TutorialTypes.simulation)
             {
                 Debug.Log("PREFORMING SIM");
                 PerformTutorial(nextTutorial);
             }
         }
     }
 }
Example #30
0
        public void SetTransformEvent()
        {
            //GameStatus.SetCurrentGameState(CurrentGameState.Dialog);
            //var dialogEvent = GameManager.Instance.GetComponent<DialogEvent>();

            //UserInterface.DialogSetActive(true);
            //tutorialUI.attack.gameObject.SetActive(true);
            //UserInterface.Instance.Dialog.SetDialog(dialogEvent.dialogs[4],
            //    () => {
            //        GameStatus.SetCurrentGameState(CurrentGameState.Tutorial);
            //        currentTutorial = TutorialEvent.Transform;
            //        //tutorialUI.move.gameObject.SetActive(true);
            //        StartCoroutine(SetSommonLocation(tutoWave[0].monsterTypes));
            //        GameManager.Instance.CharacterControl = true;
            //    });

            currentTutorial = TutorialEvent.Transform;
            StartCoroutine(SetSommonLocation(tutoWave[0].monsterTypes));
            tutorialUI.attack.skill3.gameObject.SetActive(false);
            tutorialUI.attack.special.gameObject.SetActive(true);
            tutorialUI.attack.special.text = tutoText[4];
        }
Example #31
0
            public void NotifyReady(TutorialEvent happened, object arg0, object arg1)
            {
                const int stdFuse = 400; //usual time to delay before popping up a tutorial message
                string messageStr = "";
                Rectangle dest = MessageDest;
                Rectangle imageDest = dest;
                imageDest.Y += imageDest.Height;

                // Don't show tutorial messages more than once
                if (done.Keys.Contains(happened) && done[happened])
                    return;

                done.Add(happened, true);

                if (done.Count >= 7) // TODO don't hardcode # events
                    finished = true;

                string pushing, selectLimit, intro;
                if (Util.UseXboxUI())
                {
                    pushing = Chromathud.Strings.TutorialPushingXbox;
                    selectLimit = Chromathud.Strings.TutorialSelectLimitXbox;
                    intro = Chromathud.Strings.TutorialIntroXbox;
                }
                else
                {
                    pushing = Chromathud.Strings.TutorialPushingPC;
                    selectLimit = Chromathud.Strings.TutorialSelectLimitPC;
                    intro = Chromathud.Strings.TutorialIntroPC;
                }
                switch (happened)
                {

                    case TutorialEvent.Intro:
                        messageStr = String.Format(Chromathud.Strings.TutorialIntro, (int)arg0, intro);
                        nextmessage = new TutorialMessage(Facet, messageStr, dest);
                        ticker = 500;
                        break;
                    case TutorialEvent.TargetChanged:
                        messageStr = String.Format(Chromathud.Strings.TutorialTargetChanged, (int)arg0);
                        nextmessage = new TutorialMessage(Facet, messageStr, dest);
                        ticker = stdFuse;
                        break;
                    case TutorialEvent.LotsaBlocks:
                        messageStr = String.Format(Chromathud.Strings.TutorialHowToLose);
                        nextmessage = new TutorialMessage(Facet, messageStr, dest);
                        ticker = stdFuse;
                        break;
                    case TutorialEvent.FewBlocks:
                        messageStr = String.Format(Chromathud.Strings.TutorialPushing, pushing);
                        nextmessage = new TutorialMessage(Facet, messageStr, dest);
                        if (Util.UseWindowsUI())
                        {
                            nextmessage.Image = Content.LoadImage("instros/spacebar");
                            nextmessage.ImageArea = imageDest;
                        }
                        ticker = stdFuse;
                        break;
                    case TutorialEvent.DeadBlockCreated:
                        messageStr = String.Format(Chromathud.Strings.TutorialDeadBlocks);
                        nextmessage = new TutorialMessage(Facet, messageStr, dest);
                        ticker = stdFuse;
                        break;
                    case TutorialEvent.SelectLimitReached:
                        messageStr = String.Format(Chromathud.Strings.TutorialSelectLimitReached, selectLimit);
                        nextmessage = new TutorialMessage(Facet, messageStr, dest);
                        ticker = 600;
                        break;
                    case TutorialEvent.LimitIncreased:
                        messageStr = String.Format(Chromathud.Strings.TutorialLimitIncreased, arg0);
                        nextmessage = new TutorialMessage(Facet, messageStr, dest);
                        ticker = stdFuse;
                        break;
                }
            }
    private void HandleEvent(TutorialEvent tutorialEvent)
    {
        switch (tutorialEvent)
        {
        case TutorialEvent.NONE:
            break;
        case TutorialEvent.LOAD_PRESET_LEVEL:
            LevelSelectGUI.currentLevel = Levels.GetLevel(level);
            Loading.Load(level);
            break;
        case TutorialEvent.LOAD_NEXT_LEVEL:
            LoadLevel.LoadALevel("next");
            break;
        case TutorialEvent.START_PLAYER:
            GameRecorder.StopPlayback();

            tutorialEnabled = false;

            // Disable buttons
            lastButton.enabled = false;
            nextButton.enabled = false;
            skipButton.enabled = false;

            // Get rid of mainCamera tag
            tag = "";

            // Unfreeze camera
            {
                theCamera.active = true;
                theCamera.GetComponent<LevelStart>().Start();
            }

            // Unfreeze player
            GameObject player = GameObject.Find("Player");
            if (player != null)
            {
                player.rigidbody.constraints = RigidbodyConstraints.FreezeRotation;
            }

            // Disable tutorial camera
            gameObject.active = false;
            break;
        case TutorialEvent.PLAY_RECORDING:
            string test = "Recordings/" + points[index].recordingName;
            TextAsset ta = (TextAsset)Resources.Load(test);
            Stream s = new MemoryStream(ta.bytes);
            BinaryReader br = new BinaryReader(s);
            GameRecorder.StartPlaybackTutorial(Recording.Read(br));
            break;
        case TutorialEvent.RESET_PLAYER:
            GameRecorder.StopPlayback();
            GameObject.Find("Player").BroadcastMessage("Reload");
            break;
        }
    }