예제 #1
0
        public void setup()
        {
            TutorialStep step1 = new TutorialStep()
            {
                Title = "Korak 1", Content = "Dobrodosli u aplikaciju. Pratite sledece instrukcije, kako biste naucili da je koristite."
            };

            TutorialSteps.Add(step1);

            TutorialStep step2 = new TutorialStep()
            {
                Title = "Korak 2", Content = "Da biste napravili novu ucionicu, udjite u Novi->Ucionica. Ili odradite Alt+U"
            };

            TutorialSteps.Add(step2);

            TutorialStep step3 = new TutorialStep()
            {
                Title = "Korak 3", Content = "Odlicno. Popunite podatke za novu ucionicu. Onda je dodajte."
            };

            TutorialSteps.Add(step3);

            TutorialStep step4 = new TutorialStep()
            {
                Title = "Korak 4", Content = "Sada je vreme da dodate departman. Postupak je slican kao kod ucionice.\nZa ulazak u odgovarajucu formu pritisnite (Novi->Departman ili Alt+D).\nNakon toga popunite formu."
            };

            TutorialSteps.Add(step4);

            TutorialStep step5 = new TutorialStep()
            {
                Title = "Korak 5", Content = "Dodajte predmet(Novi-> predmet ili Alt+P).\nPrimeticete da mozete da ga dodelite departmanu koji ste prethodno napravili.\nTrudite se da predmet i ucionica(koju ste dodali) budu kompatibilni po pitanju zahteva(tabla,projektor...)."
            };

            TutorialSteps.Add(step5);

            TutorialStep step6 = new TutorialStep()
            {
                Title = "Korak 6", Content = "Udjite u semu rasporeda(Raspored ili Alt+R). Prikazace vam se prozor s rasporedom gde cete moci da pravite termine."
            };

            TutorialSteps.Add(step6);

            TutorialStep step7 = new TutorialStep()
            {
                Title = "Korak 7", Content = "U semi rasporeda imate tabelu s danima i vremenom. Tabela je na nivou jedne ucionice radi preglednosti.\nIz comboboxa gore je moguce izabrati ucionicu. Termini se prave prevlacenjem dostupnih predmeta sa strane na tablu. Probajte da uradite to."
            };

            TutorialSteps.Add(step7);

            TutorialStep lastStep = new TutorialStep()
            {
                Title = "Poslednji korak", Content = "Uspesno ste zavrsili ovaj tutorial i naucili kako da upotrebljavate osnovne funkcije aplikacije. Cestitamo!"
            };

            TutorialSteps.Add(lastStep);
        }
        public IntroTutorial()
        {
            DataContext = this;
            TutorialSteps.ReplaceAll(App.TutorialService);

            //Setup languages.
            foreach (var tutorialStep in TutorialSteps)
            {
                switch (Settings.Language)
                {
                case @"int":
                    tutorialStep.UIString = tutorialStep.lang_int;
                    break;

                case @"rus":
                    tutorialStep.UIString = tutorialStep.lang_rus;
                    break;

                case @"deu":
                    tutorialStep.UIString = tutorialStep.lang_deu;
                    break;

                case @"pol":
                    tutorialStep.UIString = tutorialStep.lang_pol;
                    break;

                case @"esn":
                    tutorialStep.UIString = tutorialStep.lang_esn;
                    break;

                case @"fra":
                    tutorialStep.UIString = tutorialStep.lang_fra;
                    break;

                default:
                    Log.Error(@"Tutorial doesn't support language: " + Settings.Language);
                    break;
                }

                if (string.IsNullOrWhiteSpace(tutorialStep.UIString))
                {
                    // failover to int
                    tutorialStep.UIString = tutorialStep.lang_int;
                }

                tutorialStep.UIString    = tutorialStep.UIString.Replace(@"\n", "\n"); //do not localize
                tutorialStep.UIImagePath = Path.Combine(Utilities.GetTutorialServiceCache(), tutorialStep.imagename);
            }

            CurrentStep = TutorialSteps[0];
            LoadCommands();
            InitializeComponent();
        }
예제 #3
0
        private void ShowInstruction()
        {
            Debug.Log($"Calibrating pose {currentPose} for {lrName} hand");
            handAnimator.SetInteger("handState", (int)currentPose);
            currentStep = Step.Wait;
            switch (currentPose)
            {
            case Pose.HandOpen:
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(audioClips.handOpen, queue: false);
                TutorialSteps.PublishNotification($"Open your {lrName} hand", Mathf.Max(audioClips.handOpen.length, calibrationParams.waitTime + calibrationParams.dwellTime));
                break;

            case Pose.HandClosed:
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(audioClips.handClosed, queue: false);
                TutorialSteps.PublishNotification($"Make a fist with your {lrName} hand", Mathf.Max(audioClips.handClosed.length, calibrationParams.waitTime + calibrationParams.dwellTime));
                break;

            //case Pose.FingersExt:
            //    TutorialSteps.Instance.audioManager.ScheduleAudioClip(fingersExt, queue: false);
            //    SendToast($"Extend your {right} fingers", waitTime + dwellTime);
            //    break;
            //case Pose.FingersFlexed:
            //    TutorialSteps.Instance.audioManager.ScheduleAudioClip(fingersFlexed, queue: false);
            //    SendToast($"Flex your {right} fingers", waitTime + dwellTime);
            //    break;
            case Pose.ThumbUp:
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(audioClips.thumbUp, queue: false);
                TutorialSteps.PublishNotification("Give me a thumbs up", Mathf.Max(audioClips.thumbUp.length, calibrationParams.waitTime + calibrationParams.dwellTime));
                break;

            case Pose.ThumbFlex:
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(audioClips.thumbFlex, queue: false);
                TutorialSteps.PublishNotification($"Flex your {lrName} thumb", Mathf.Max(audioClips.thumbFlex.length, calibrationParams.waitTime + calibrationParams.dwellTime));
                break;

            case Pose.AbdOut:
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(audioClips.abdOut, queue: false);
                TutorialSteps.PublishNotification($"Move your {lrName} thumb out", Mathf.Max(audioClips.abdOut.length, calibrationParams.waitTime + calibrationParams.dwellTime));
                break;

            //case Pose.NoThumbAbd:
            //    TutorialSteps.Instance.audioManager.ScheduleAudioClip(noThumbAbd, queue: false);
            //    SendToast($"Move your {right} thumb up", waitTime + dwellTime);
            //    break;
            default:
                Debug.LogError($"Pose unknown: {currentPose}");
                break;
            }
        }
예제 #4
0
 public void EndTurn()
 {
     GameplayComponent.EndTurnButton.interactable = false;
     HideNotify();
     if (markObject)
     {
         Destroy(markObject);
     }
     if (TutorialCurrentStep == TutorialSteps.step1)
     {
         TutorialCurrentStep = TutorialSteps.step2;
         StartCoroutine(TutorialStep2());
     }
     else if (TutorialCurrentStep == TutorialSteps.step2)
     {
         TutorialCurrentStep = TutorialSteps.step3;
         StartCoroutine(TutorialStep3());
     }
     else if (TutorialCurrentStep == TutorialSteps.step3)
     {
         TutorialCurrentStep = TutorialSteps.step4;
         StartCoroutine(TutorialStep4());
     }
     else if (TutorialCurrentStep == TutorialSteps.step4)
     {
         TutorialCurrentStep = TutorialSteps.step5;
         StartCoroutine(TutorialStep5());
     }
     else if (TutorialCurrentStep == TutorialSteps.step5)
     {
         TutorialCurrentStep = TutorialSteps.step6;
         StartCoroutine(TutorialStep6());
     }
     else if (TutorialCurrentStep == TutorialSteps.step6)
     {
         TutorialCurrentStep = TutorialSteps.step7;
         StartCoroutine(TutorialStep7());
     }
     else if (TutorialCurrentStep == TutorialSteps.step7)
     {
         TutorialCurrentStep = TutorialSteps.step8;
         StartCoroutine(TutorialStep8());
     }
     //GameplayComponent.EnemyCardDraw ();
 }
예제 #5
0
    private void Update()
    {
        if (currentStep == TutorialSteps.PreTutorial)
        {
            if (Input.GetButtonDown("Dash"))
            {
                StartTutorial();
                TutorialText.SetActive(false);
                clone.SetActive(true);
            }
            if (Input.GetButtonDown("Jump"))
            {
                currentStep = TutorialSteps.TutorialPreFinish;
                TutorialText.SetActive(false);
            }
        }

        if (currentStep == TutorialSteps.MovementInfo && !tutorialPlay)
        {
            cloneAnim.PlayRunning(true);
            tutorialContainer.SetActive(true);
            tmproText.text = "Use joystick for movement";
            anim.Play("AnimMove");
            tutorialTimer = setTimer;
            tutorialPlay  = true;
        }
        if (currentStep == TutorialSteps.MovementTest)
        {
            if ((Input.GetAxis("Horizontal") > 0 || Input.GetAxis("Horizontal") < 0 ||
                 Input.GetAxis("Vertical") > 0 || Input.GetAxis("Vertical") < 0) &&
                !tutorialPlay)
            {
                tutorialTimer = 2;
                tutorialPlay  = true;
            }
        }
        if (currentStep == TutorialSteps.DashInfo && !tutorialPlay)
        {
            cloneAnim.PlayRunning(false);
            cloneAnim.PlayDash(true);
            tmproText.text = "Press A to dash, dash three times.";
            anim.Play("AnimDash");
            tutorialTimer = setTimer;
            tutorialPlay  = true;
        }
        if (currentStep == TutorialSteps.DashTest)
        {
            if (Input.GetButtonDown("Dash") && !tutorialPlay && hitCounter <= 2)
            {
                hitCounter++;
            }
            else if (hitCounter >= 3)
            {
                currentStep += 1;
                hitCounter   = 0;
            }
        }
        if (currentStep == TutorialSteps.AttackInfo && !tutorialPlay)
        {
            cloneAnim.PlayDash(false);
            cloneAnim.PlayAttack(true);
            tmproText.text = "Press RB to slash, slash three times.";
            anim.Play("AnimAttack");
            tutorialTimer = setTimer;
            tutorialPlay  = true;
        }
        if (currentStep == TutorialSteps.AttackTest)
        {
            if (Input.GetButtonDown("Attack") && !tutorialPlay && hitCounter <= 2)
            {
                hitCounter++;
            }
            else if (hitCounter >= 3)
            {
                currentStep += 1;
                hitCounter   = 0;
            }
        }
        if (currentStep == TutorialSteps.DanceInfo && !tutorialPlay)
        {
            cloneAnim.PlayAttack(false);
            cloneAnim.PlayDance(true);
            tmproText.text = "Press B to dance, dance three times.";
            anim.Play("AnimDance");
            tutorialTimer = setTimer;
            tutorialPlay  = true;
        }
        if (currentStep == TutorialSteps.DanceTest)
        {
            if (Input.GetButtonDown("Dance") && !tutorialPlay && hitCounter <= 2)
            {
                hitCounter++;
            }
            else if (hitCounter >= 3)
            {
                currentStep     += 1;
                hitCounter       = 0;
                juiceMeter.value = 0;
            }
        }
        if (currentStep == TutorialSteps.JuiceInfo && !tutorialPlay)
        {
            tmproText.text = "Hit the beat three times, use your dash, shlash or dance.";
            tutorialTimer  = setTimer;
            tutorialPlay   = true;
        }
        if (currentStep == TutorialSteps.JuiceTest)
        {
            if (juiceMeter.value >= 15)
            {
                currentStep += 1;
                cloneAnim.PlayDance(false);
            }
        }
        if (currentStep == TutorialSteps.EmpowerSlashInfo && !tutorialPlay)
        {
            tmproText.text = "Hit the beat with the dance three times and \n then slash on beat to perform an Empowered Slash. Defeat the holograms.";
            anim.Play("Enchancedslash");
            foreach (GameObject clone in EmpowerClone)
            {
                clone.SetActive(true);
            }
            tutorialTimer = setTimer;
            tutorialPlay  = true;
        }
        if (currentStep == TutorialSteps.EmpowerSlashTest)
        {
            if (EmpowerClone.Count == 0)
            {
                currentStep += 1;
            }
        }
        if (currentStep == TutorialSteps.JuiceDashInfo && !tutorialPlay)
        {
            tmproText.text = "At max juice, you can perform the Juice Dash, hold LT and A.\n The longer you charge the more enemies will be hit. Defeat the holograms.";
            anim.Play("Juicedash");
            foreach (GameObject clone in JuiceDashClone)
            {
                clone.SetActive(true);
            }
            tutorialTimer = setTimer;
            tutorialPlay  = true;
        }
        if (currentStep == TutorialSteps.JuiceDashTest)
        {
            juiceMeter.value += 1;

            if (JuiceDashClone.Count == 0)
            {
                currentStep     += 1;
                juiceMeter.value = 0;
                tutorialContainer.SetActive(false);
            }
        }
        if (currentStep == TutorialSteps.TutorialPreFinish)
        {
            if (gate != null)
            {
                gateMaterial.SetFloat("Vector1_36A0E93A", Mathf.Lerp(gateMaterial.GetFloat("Vector1_36A0E93A"), 1f, 0.02f));
                gateGoldMaterial.SetFloat("Vector1_36A0E93A", Mathf.Lerp(gateGoldMaterial.GetFloat("Vector1_36A0E93A"), 1f, 0.02f));

                if (gateMaterial.GetFloat("Vector1_36A0E93A") >= 0.73f)
                {
                    clone.SetActive(false);
                    gate.SetActive(false);
                    currentStep += 1;
                }
            }
        }
        if (currentStep == TutorialSteps.TutorialFinish)
        {
        }

        if (tutorialPlay)
        {
            //Debug.Log(tutorialTimer);
            tutorialTimer -= Time.deltaTime;
        }
        if (tutorialTimer <= 0)
        {
            tutorialPlay  = false;
            currentStep  += 1;
            tutorialTimer = 1;
        }
    }
예제 #6
0
 public void StartTutorial()
 {
     currentStep = TutorialSteps.MovementInfo;
 }
예제 #7
0
 public void Testing()
 {
     currentStep = TutorialSteps.TutorialPreFinish;
 }
예제 #8
0
        // Update is called once per frame
        void Update()
        {
            // load old calibration if existing
            if (interpolator == null &&
                hand.IsLinked &&
                hand.GetInterpolationProfile(out interpolator))
            {
                poses = LoadProfiles();
                Debug.Log($"Connected {(isRight ? "right" : "left")} Hand");
            }

            // only start the calibration, if the SenseGlove could be found and the calibrating flag was set
            if (calibrating && hand.IsLinked)
            {
                switch (currentStep)
                {
                // 1. show instruction
                case Step.ShowInstruction:
                {
                    virtualHand.SetActive(true);
                    ShowInstruction();
                    break;
                }

                // 2. wait
                case Step.Wait:
                {
                    calibrationParams.waitTimer.LetTimePass(Time.deltaTime);
                    poseStore.Clear();
                    break;
                }

                // 3. dwell
                case Step.Dwell:
                {
                    if (TutorialSteps.Instance.audioManager.IsAudioPlaying())
                    {
                        break;
                    }
                    calibrationParams.dwellTimer.LetTimePass(Time.deltaTime);
                    completionWidget.active   = true;
                    completionWidget.text     = "calibrating";
                    completionWidget.progress = calibrationParams.dwellTimer.GetFraction();

                    poseStore.AddPose(GetCurrentPoseValues());
                    float error = poseStore.ComputeError();
                    if (error > calibrationParams.maxError)
                    {
                        const string warningText = "Finger position changed too much, retry";
                        Debug.LogWarning(warningText);

                        poseStore.Clear();
                        calibrationParams.dwellTimer.ResetTimer();
                    }
                    break;
                }

                // 3.5 finish calibration & init testing phase
                case Step.TestInit:
                {
                    hand.SaveHandCalibration();
                    virtualHand.SetActive(false);
                    Debug.Log($"Saved Calibration Profiles for {lrName} hand");

                    TutorialSteps.Instance.audioManager.ScheduleAudioClip(audioClips.test, queue: false);
                    TutorialSteps.PublishNotification($"{lrName} thumbs up to continue", audioClips.test.length + testParams.dwellTime);
                    handAnimator.SetInteger("handState", (int)Pose.ThumbUp);

                    currentStep = Step.Test;
                    goto case Step.Test;
                }

                // 4. test calibration
                case Step.Test:
                {
                    if (TutorialSteps.Instance.audioManager.IsAudioPlaying())
                    {
                        break;
                    }
                    PoseBuffer buffer = new PoseBuffer(bufferSize: 2);
                    buffer.AddPose(poseValues[(int)Pose.ThumbUp]);
                    buffer.AddPose(GetCurrentPoseValues());
                    float error = buffer.ComputeError();
                    testParams.dwellTimer.LetTimePass(Time.deltaTime);
                    if (error > testParams.maxError)
                    {
                        testParams.dwellTimer.ResetTimer();
                    }

                    completionWidget.text     = "hold";
                    completionWidget.active   = true;
                    completionWidget.progress = testParams.dwellTimer.GetFraction();
                    break;
                }

                // 5. calibration done
                case Step.Done:
                {
                    calibrating             = false;
                    completionWidget.active = false;
                    doneCallbacks.Call(currentStep);
                    break;
                }

                default: break;
                }
            }
        }
예제 #9
0
        void Start()
        {
            currentState = State.START;

            StateManager.Instance.onStateChangeTo[StateManager.States.HUD].Add((s) => StopCalibration(), once: true);

            // get objectives
            foreach (var comp in PlayerRig.Instance.gameObject.GetComponentsInChildren <XROffset>())
            {
                if (comp.isRight)
                {
                    rightHandObjective = comp.transform;
                    rightHand          = comp.orientation.target;
                }
                else
                {
                    leftHandObjective = comp.transform;
                    leftHand          = comp.orientation.target;
                }
            }
            // get arms
            leftShoulder  = GameObject.Find("shoulder_left_axis0").transform;
            rightShoulder = GameObject.Find("shoulder_right_axis0").transform;

            #region StateDefinitions
            stateMachine.onEnter[State.START] = (state) =>
            {
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(armLengthAudioClips.start,
                                                                      onEnd: () => Next());
            };

            stateMachine.onEnter[State.RIGHT_SHOULDER_TOUCH] = (state) =>
            {
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(armLengthAudioClips.touch_right,
                                                                      onStart: () =>
                {
                    TutorialSteps.PublishNotification("Touch your right shoulder with your left arm");
                    rightShoulderVolume.StartWaiting();
                }, queue: true);
                rightShoulderVolume.OnDone((b) =>
                {
                    leftArmTouchpoint.position = new Vector3(
                        leftHandObjective.position.x,
                        leftShoulder.position.y,
                        leftShoulder.position.z
                        );
                    Next();
                }, once: true);
            };
            stateMachine.onExit[State.RIGHT_SHOULDER_TOUCH] = (state) =>
            {
                rightShoulderVolume.StopWaiting();
            };

            stateMachine.onEnter[State.LEFT_SHOULDER_TOUCH] = (state) =>
            {
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(armLengthAudioClips.touch_left,
                                                                      onStart: () =>
                {
                    TutorialSteps.PublishNotification("Touch your left shoulder with your right arm");
                    leftShoulderVolume.StartWaiting();
                });
                leftShoulderVolume.OnDone((b) =>
                {
                    rightArmTouchpoint.position = new Vector3(
                        rightHandObjective.position.x,
                        rightShoulder.position.y,
                        rightShoulder.position.z
                        );
                    Next();
                }, once: true);
            };
            stateMachine.onExit[State.LEFT_SHOULDER_TOUCH] = (state) =>
            {
                leftShoulderVolume.StopWaiting();
            };


            stateMachine.onEnter[State.LEFT_SCALE] = (state) =>
            {
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(armLengthAudioClips.scale_left);
                TutorialSteps.PublishNotification("Strech your left arm fully");
                TutorialSteps.PublishNotification("Left thumbs up to calibrate");
                UserInteractionManager.Instance.Confirm((b) =>
                {
                    FitLeft();
                    Next();
                }, left: true, once: true);
            };

            stateMachine.onEnter[State.RIGHT_SCALE] = (state) =>
            {
                TutorialSteps.Instance.audioManager.ScheduleAudioClip(armLengthAudioClips.scale_right);
                TutorialSteps.PublishNotification("Strech your right arm fully");
                TutorialSteps.PublishNotification("Right thumbs up to calibrate");
                UserInteractionManager.Instance.Confirm((b) =>
                {
                    FitRight();
                    Next();
                }, left: false, once: true);
            };

            stateMachine.onEnter[State.DONE] = (state) =>
            {
                Save();
                onDoneCallbacks.Call(State.DONE);
            };
            #endregion

            Load();
        }