コード例 #1
0
    private IEnumerator EndTutorial()
    {
        GameManager.playerTeamsAlreadySelected = true;
        GameManager.playerTeamAssignments      = new Dictionary <int, int>();
        foreach (Player player in GameManager.instance.GetPlayersWithTeams())
        {
            int teamIndex = GameManager.instance.teams.IndexOf(player.team);
            GameManager.playerTeamAssignments[player.playerNumber] = teamIndex;
        }
        TeamManager.playerSpritesAlreadySet = true;


        skipTutorialCheckin.ResetCheckin();
        skipTutorialCheckin.StartListening();
        skipText.text = "Hold <YButton> to skip the tutorial";
        // Start the countdown.
        float start = Time.realtimeSinceStartup;
        float diff  = Time.realtimeSinceStartup - start;

        // TODO: if slowmo becomes possible here might wanna use realtime instead
        readyUpText.text = "";
        while (diff < tutorialStartTime &&
               !skipTutorialCheckin.AllCheckedIn() &&
               !skipReadyUpCheat)
        {
            if (teamSelectionLineTwo != null)
            {
                teamSelectionLineTwo.text = String.Format(
                    "Starting tutorial in {0:N0}", Mathf.Ceil(tutorialStartTime - diff));
            }
            diff = Time.realtimeSinceStartup - start;
            yield return(null);
        }

        // Switch to Tutorial scene.
        yield return(null);

        skipTutorialCheckin.StopListening();
        yield return(new WaitForSeconds(0.5f));

        if (skipTutorialCheckin.AllCheckedIn())
        {
            SkipTutorial();
        }
        else
        {
            SceneStateManager.instance.Load(Scene.Tutorial);
        }
    }
コード例 #2
0
    private IEnumerator Clips()
    {
        runningLiveClips = true;
        StartListeningForPlayers();
        GameManager.NotificationManager.CallOnMessage(Message.RecordingFinished,
                                                      () =>
        {
            if (!clipReloadThisFrame)
            {
                ClipReload();
                clipReloadThisFrame = true;
                this.FrameDelayCall(() => clipReloadThisFrame = false, 3);
            }
        });
        GameManager.NotificationManager.CallOnMessage(Message.RecordingInterrupt,
                                                      SubclipInterrupt);
        yield return(null);

        ySkip.StartListening();
        foreach (LiveClipInfo liveClip in liveClips)
        {
            clipReloadThisFrame = false;
            currentClip         = liveClip;
            ResetCheckin();
            currentClipName = liveClip.clipName;
            currentSubclips = liveClip.subclipInfo;
            yield return(new WaitForSecondsRealtime(liveClip.preDelay));

            LoadLiveClip(currentClipName);
            yield return(null);

            while (!AllCheckedIn() && !ySkip.AllCheckedIn())
            {
                yield return(null);
            }
            yield return(null);

            TransitionUtility.OneShotFadeTransition(0.3f, 0.2f);
            yield return(new WaitForSecondsRealtime(0.15f));

            UnloadCurrentClip();
            yield return(null);

            if (ySkip.AllCheckedIn())
            {
                break;
            }
        }
        TransitionUtility.OneShotFadeTransition(0.1f, 0.4f);
        yield return(new WaitForSeconds(0.05f));

        runningLiveClips = false;
        if (ySkip.AllCheckedIn())
        {
            PlayerTutorial.SkipTutorial();
        }
        else
        {
            SceneStateManager.instance.Load(Scene.Sandbox);
        }
    }