예제 #1
0
        private void OnTapped()
        {
            switch (currentState)
            {
            case IntroductionState.IntroductionStatePlaceEarth:
                if (!SkipPlaceEarth)
                {
                    AdvanceIntroduction();
                }
                break;

            case IntroductionState.IntroductionStateLogo:
                AdvanceIntroduction();
                break;

            case IntroductionState.IntroductionStateAppDescription:
            case IntroductionState.IntroductionStateDevelopers:
            case IntroductionState.IntroductionStateCommunity:
                // skip intro
                currentState = IntroductionState.IntroductionStateCommunity;
                VOManager.Instance.Stop(clearQueue: true);
                AdvanceIntroduction();
                break;
            }
        }
예제 #2
0
    private void AdvanceIntroduction()
    {
        if (coreSystemsLoaded)
        {
            // change settings
            switch (currentState)
            {
            case IntroductionState.IntroductionStateSlateFadeout:
                InstructionSlate.gameObject.SetActive(false);

                Logo.gameObject.SetActive(true);
                Tagalong tagalong = Logo.gameObject.GetComponent <Tagalong>();
                float    distance = 2.0f;

                if (tagalong != null)
                {
                    distance = tagalong.TagalongDistance;
                }

                // position the logo and orient it towards the user
                Logo.gameObject.transform.position = Camera.main.transform.position + (Camera.main.transform.forward * distance);

                Vector3 forwardDirection = Logo.gameObject.transform.position - Camera.main.transform.position;
                Logo.gameObject.transform.rotation = Quaternion.LookRotation(forwardDirection.normalized);

                logoAnimator.SetTrigger("FadeIn");
                PlayOneShot(LogoHydrate);
                break;

            case IntroductionState.IntroductionStateLogo:
                logoAnimator.SetTrigger("FadeOut");
                break;

            case IntroductionState.IntroductionStateLogoFadeout:
                Logo.gameObject.SetActive(false);
                ViewLoader.Instance.transform.position = Camera.main.transform.position + (Camera.main.transform.forward * 2.0f);
                ViewLoader.Instance.transform.rotation = Quaternion.LookRotation(Camera.main.transform.position - ViewLoader.Instance.transform.position);
                StartCoroutine(ViewLoader.Instance.LoadStartingView());
                TransitionManager.Instance.ContentLoaded += ContentLoaded;
                placementControl.ContentPlaced           += ContentPlaced;
                break;

            case IntroductionState.IntroductionStatePreloadSolarSystem:
                VOManager.Instance.PlayClip(CenterEarth);
                break;
            }

            currentState = (IntroductionState)(currentState + 1);
            if (currentState == IntroductionState.IntroductionStateComplete)
            {
                TransitionManager.Instance.ShowToolsAndCursor();
                Destroy(gameObject);
                return;
            }

            UpdateInstructions();
            timeInState = 0.0f;
        }
    }
예제 #3
0
    private void OnTapped(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        switch (currentState)
        {
        case IntroductionState.IntroductionStatePlaceEarth:
        case IntroductionState.IntroductionStateLogo:
            AdvanceIntroduction();
            break;

        case IntroductionState.IntroductionStateAppDescription:
        case IntroductionState.IntroductionStateDevelopers:
        case IntroductionState.IntroductionStateCommunity:
            // skip intro
            currentState = IntroductionState.IntroductionStateCommunity;
            VOManager.Instance.Stop(clearQueue: true);
            AdvanceIntroduction();
            break;
        }
    }
        public string GetIntroductionStateText(IntroductionState introductionState)
        {
            switch (introductionState)
            {
            case IntroductionState.NotIntroduced:
                return("Ikke innført");

            case IntroductionState.Planned:
                return("Direkteoppdatering planlagt innført {0}");

            case IntroductionState.Introduced:
                return("Direkteoppdatering innført");

            case IntroductionState.Geosynch:
                return("Geosynkronisering innført");

            default:
                throw new InvalidEnumArgumentException();
            }
        }
예제 #5
0
 private void Initialize()
 {
     gameLanguage = mapInfo.GetGameLanguage();
     if (gameLanguage == MapInfo.Language.English)
     {
         CurrentLocale = localeEN;
     }
     else if (gameLanguage == MapInfo.Language.Japanese)
     {
         CurrentLocale = localeJP;
     }
     HowToPlayText.text = CurrentLocale.GetLabelContent("HowToPlay") + "\n" +
                          CurrentLocale.GetLabelContent("Rule1") + "\n" +
                          CurrentLocale.GetLabelContent("Rule2") + "\n" +
                          CurrentLocale.GetLabelContent("Rule3");
     ControlText.text = CurrentLocale.GetLabelContent("Control") + "\n" +
                        CurrentLocale.GetLabelContent("Keyboard") + "\n" +
                        CurrentLocale.GetLabelContent("KeyboardSetting1") + "\n" +
                        CurrentLocale.GetLabelContent("KeyboardSetting2") + "\n" +
                        CurrentLocale.GetLabelContent("JoyStick") + "\n" +
                        CurrentLocale.GetLabelContent("JoyStickSetting");
     CurrentState = IntroductionState.HowToPlay;
 }
예제 #6
0
 // Update is called once per frame
 void Update()
 {
     if (GameController.Instance.CurrentState == GameController.State.Introduction)
     {
         if (CurrentState == IntroductionState.HowToPlay)
         {
             HowToPlayText.gameObject.SetActive(true);
             ControlText.gameObject.SetActive(false);
             PressText.text = "Press Any Button To Continue";
             if (Input.anyKeyDown)
             {
                 CurrentState = IntroductionState.Control;
             }
         }
         else if (CurrentState == IntroductionState.Control)
         {
             HowToPlayText.gameObject.SetActive(false);
             ControlText.gameObject.SetActive(true);
             PressText.text = "Press Any Button To Start";
             if (Input.anyKeyDown)
             {
                 if (Input.GetKeyDown(KeyCode.Backspace))
                 {
                     CurrentState = IntroductionState.HowToPlay;
                 }
                 else
                 {
                     CurrentState = IntroductionState.ReadyForStart;
                 }
             }
         }
         color.a         = alpha;
         PressText.color = color;
         alpha           = Mathf.Sin(Time.time) / 2 + 0.5f;
     }
 }
예제 #7
0
        private IEnumerator EndRound_Coroutine(bool win)
        {
            var winDelay1         = leftArea.celebrationDuration + 1.5f;
            var winDelay2         = 1.5f;
            var friendlyExitDelay = leftArea.friendlyExitDuration;
            var loseDelay         = 1.5f;

            HideLetterPicker();

            if (win)
            {
                Debug.Log("Win");

                if (isTutorialRound)
                {
                    Debug.Log("Cleared tutorial");
                    HideTutorialUI();
                }

                GetConfiguration().Context.GetAudioManager().PlaySound(Sfx.Win);
                leftArea.Celebrate();
                rightArea.Celebrate();
                leftArea.HighFive(leftArea.celebrationDuration);
                rightArea.HighFive(rightArea.celebrationDuration);
                roundResultAnimator.ShowWin();
                if (!isTutorialRound)
                {
                    CurrentScore++;
                }

                // Exit
                yield return(new WaitForSeconds(winDelay1));

                roundResultAnimator.Hide();
                leftArea.MakeFriendlyExit();
                rightArea.MakeFriendlyExit();

                // Go to Friends Zone
                if (!isTutorialRound)
                {
                    yield return(new WaitForSeconds(friendlyExitDelay));

                    leftArea.GoToFriendsZone(FriendsZonesManager.instance.currentZone);
                    rightArea.GoToFriendsZone(FriendsZonesManager.instance.currentZone);
                    FriendsZonesManager.instance.IncrementCurrentZone();
                }

                // Hide answer Drop Zone
                yield return(new WaitForSeconds(winDelay2));

                HideDropZone();

                if (isTutorialRound)
                {
                    isTutorialRound = false;
                    IntroductionState.OnFinishedTutorial();
                }
                else
                {
                    NextRound();
                }
            }
            else
            {
                Debug.Log("Lose");

                GetConfiguration().Context.GetAudioManager().PlaySound(Sfx.Lose);
                yield return(new WaitForSeconds(loseDelay));

                HideDropZone();
                roundResultAnimator.ShowLose();
                //TutorialUI.MarkNo(Vector3.zero, TutorialUI.MarkSize.Huge);
                NextRound(loseDuration);
            }
        }
예제 #8
0
        private IEnumerator EndRound_Coroutine(bool win)
        {
            var winDelay1         = leftArea.celebrationDuration + 1.5f;
            var winDelay2         = 1.5f;
            var friendlyExitDelay = leftArea.friendlyExitDuration;
            var loseDelay         = 1.5f;

            HideLetterPicker();

            if (win)
            {
                Debug.Log("Win");

                if (isTutorialRound)
                {
                    Debug.Log("Cleared tutorial");
                    HideTutorialUI();
                }

                List <LL_LetterData> letters = new List <LL_LetterData>();

                foreach (var l in commonLetters)
                {
                    LL_LetterData data = l as LL_LetterData;

                    if (data != null)
                    {
                        letters.Add(data);
                    }
                }

                livingLetter1.MarkLetters(letters, Color.green);
                livingLetter2.MarkLetters(letters, Color.green);

                GetConfiguration().Context.GetAudioManager().PlaySound(Sfx.Win);
                leftArea.Celebrate();
                rightArea.Celebrate();
                leftArea.HighFive(leftArea.celebrationDuration);
                rightArea.HighFive(rightArea.celebrationDuration);
                roundResultAnimator.ShowWin();
                if (!isTutorialRound)
                {
                    CurrentScore++;
                    Context.GetLogManager().OnAnswered(wordData1, true);
                    Context.GetLogManager().OnAnswered(wordData2, true);
                }

                // Exit
                yield return(new WaitForSeconds(winDelay1));

                roundResultAnimator.Hide();
                leftArea.MakeFriendlyExit();
                rightArea.MakeFriendlyExit();

                // Go to Friends Zone
                if (!isTutorialRound)
                {
                    yield return(new WaitForSeconds(friendlyExitDelay));

                    leftArea.GoToFriendsZone(FriendsZonesManager.instance.currentZone);
                    rightArea.GoToFriendsZone(FriendsZonesManager.instance.currentZone);
                    FriendsZonesManager.instance.IncrementCurrentZone();
                }

                // Hide answer Drop Zone
                yield return(new WaitForSeconds(winDelay2));

                HideDropZone();

                if (isTutorialRound)
                {
                    isTutorialRound = false;
                    IntroductionState.OnFinishedTutorial();
                }
                else
                {
                    NextRound();
                }
            }
            else
            {
                Debug.Log("Lose");

                Context.GetLogManager().OnAnswered(wordData1, false);
                Context.GetLogManager().OnAnswered(wordData2, false);

                GetConfiguration().Context.GetAudioManager().PlaySound(Sfx.Lose);
                yield return(new WaitForSeconds(loseDelay));

                HideDropZone();
                roundResultAnimator.ShowLose();
                //TutorialUI.MarkNo(Vector3.zero, TutorialUI.MarkSize.Huge);
                NextRound(loseDuration);
            }
        }