Example #1
0
    private void OnContinueTutorialFrom(TutorialKey key)
    {
        switch (key)
        {
        case TutorialKey.Welcome:
            deliveryDirector.Resume();
            break;

        case TutorialKey.MorningDelivery:
            deliveryDirector.Resume();
            break;

        case TutorialKey.MorningDeliveryDone:
            break;

        case TutorialKey.ItemSetup:
            break;

        case TutorialKey.ItemSetupFront:
            break;

        case TutorialKey.ItemSetupPull:
            break;

        case TutorialKey.ItemSetupReady:
            break;

        case TutorialKey.AutoSales:
            break;

        default:
            throw new ArgumentOutOfRangeException(nameof(key), key, null);
        }
    }
Example #2
0
            internal void StartCapture()
            {
                // First capture to touch the playable directors
                if (!_isCapturing)
                {
                    // Null check in case director no longer exists
                    if (_director != null)
                    {
                        // Want to manually update?
                        // TODO: should we include ALL directors, as they may switch from manual to something else later on?
                        // DSPClock doesn't change rate when rendering offline, so we need to change to GameTime
                        _isControlling = (_director.timeUpdateMode == DirectorUpdateMode.DSPClock);

                        if (_isControlling)
                        {
                            // Cache original update mode
                            _originalTimeUpdateMode = _director.timeUpdateMode;

                            bool wasPlaying = (_director.state == PlayState.Playing);

                            // Set to manual update mode
                            // NOTE: Prior to Unity 2018.2 changing from DSP Clock to Manual did nothing, as DSP Clock mode was set to ignore manual updates
                            _director.timeUpdateMode = DirectorUpdateMode.GameTime;

                            // NOTE: In newer versions of Unity (post 2018.2) changing the timeUpdateMode to Manual pauses playback, so we must resume it
                            if (wasPlaying && _director.state == PlayState.Paused)
                            {
                                _director.Resume();
                            }
                        }
                    }
                    _isCapturing = true;
                }
            }
Example #3
0
 public void OnExposedItem()
 {
     if (currentTutorialKey == TutorialKey.ItemSetup || currentTutorialKey == TutorialKey.ItemSetupFront)
     {
         HideSelfTutorial();
         itemSetupDirector.Resume();
     }
 }
Example #4
0
 private void OnAnimationLooped(object sender, AnimationLoopedEventArgs e)
 {
     if (m_hasTimeline)
     {
         m_playableDirector.set_time(0.0);
         m_playableDirector.Resume();
     }
 }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        if (DialogueNum >= s_Dialogue.Length)
        {
            return;
        }

        if (nextDialog > DialogueNum)
        {
            PlayableDir.Pause();
            Coroutine tempCor = null;

            if (!b_EffectEnd)
            {
                tempCor     = StartCoroutine(TextBoxEffect());
                b_EffectEnd = true;
            }
            if (Input.anyKeyDown)
            {
                b_EffectEnd = false;
                if (tempCor != null)
                {
                    StopCoroutine(tempCor);
                }
                DialogueNum    += 1;
                t_Dialogue.text = "";
                PlayableDir.Resume();
            }
        }


        //if (b_Stop)
        //{
        //    if (b_EffectEnd)
        //    {
        //        if (Input.anyKeyDown)
        //        {
        //            b_Stop = false;
        //            b_EffectEnd = false;
        //            DialogueNum += 1;
        //            t_Dialogue.text = "";
        //            PlayableDir.Resume();
        //        }
        //    }
        //    else
        //    {
        //        b_EffectEnd = true;
        //        PlayableDir.Pause();
        //        StartCoroutine(TextBoxEffect());

        //    }
        //}
    }
Example #6
0
 //Called by the InputManager
 public void ResumeTimeline()
 {
     UIManager.Instance.TogglePressSpacebarMessage(false);
     UIManager.Instance.ToggleDialoguePanel(false);
     activeDirector.Resume();
     gameMode = GameMode.Gameplay;
 }
    IEnumerator EndCoroutine()
    {
        while (animator.GetCurrentAnimatorStateInfo(0).IsName("Cut"))
        {
            Debug.Log("Wait");
            yield return(new WaitForEndOfFrame());
        }
        endText.text = "THEY SURVIVED FOR <b>" + _gameManager.timeSurvived.ToString("00") + "</b> SECONDS";
        animator.SetTrigger("End");
        WaitForSeconds ws2 = new WaitForSeconds(0.3f);

        yield return(ws2);

        if (mode == SpectatorMode.Cinematic)
        {
            timeline.Pause();
        }
        WaitForSeconds ws = new WaitForSeconds(3.3f);

        yield return(ws);

        if (mode == SpectatorMode.Cinematic)
        {
            timeline.Resume();
        }
    }
Example #8
0
 private void ShowDeathCutScene()
 {
     _deathPlayableDirector.time = -0.5f;
     _deathPlayableDirector.transform.position = Player.Position;
     _deathPlayableDirector.gameObject.SetActive(true);
     _deathPlayableDirector.Resume();
 }
Example #9
0
 public void Resume()
 {
     if (director && director.state == PlayState.Paused)
     {
         director.Resume();
     }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param @name="data"></param>
        public void Process(object data)
        {
            if (!_IsValid())
            {
                return;
            }

            if (action == ActionType.Play)
            {
                timeline.Play();
            }
            else if (action == ActionType.Pause)
            {
                timeline.Pause();
            }
            else if (action == ActionType.Resume)
            {
                timeline.Resume();
            }
            else if (action == ActionType.Stop)
            {
                timeline.Stop();
            }
            else if (action == ActionType.SkipTo)
            {
                time          = Mathf.Abs(time);
                timeline.time = time;
            }
        }
Example #11
0
        public void OnGUI()
        {
            if (this.ShowPauseTimeline)
            {
                PlayableDirector component = (PlayableDirector)((Component)this).GetComponent <PlayableDirector>();
                Rect             rect;
                ((Rect) ref rect).\u002Ector(20f, 50f, 130f, 30f);
                if (!this._isCameraFree)
                {
                    if (GUI.Button(rect, "Free Camera"))
                    {
                        this._isCameraFree = true;
                        component.Pause();
                    }
                }
                else if (GUI.Button(rect, !((Behaviour)component).get_isActiveAndEnabled() ? "Lock Camera" : "Resume Timeline"))
                {
                    this._isCameraFree = false;
                    component.Resume();
                }
            }
            Rect rect1;

            ((Rect) ref rect1).\u002Ector(20f, 95f, 130f, 30f);
            if (!GUI.Button(rect1, "Back To Menu"))
            {
                return;
            }
            SceneManager.LoadScene("0. Demo Menu");
        }
    public void SetState(States state)
    {
        this.state = state;

        switch (state)
        {
        default:
        case States.Bringing:
            // Reset everything
            touchHelper = new TouchHelper();

            var op = operatorLibrary.GetRandomOperator();
            lockerController.currentRarity = op.rarity;
            operatorView.SetInfo(op);
            audioController.SetInfo(op);

            break;

        case States.Touching:
            playableDirector.Pause();
            break;

        case States.Opening:
            playableDirector.Resume();
            break;

        case States.AfterOpening:
            playableDirector.Pause();
            break;
        }
    }
Example #13
0
    /// <summary>
    /// Update is called once per frame
    /// </summary>
    void Update()
    {
        if (pauseMenu.activeSelf)
        {
            //Video is paused
            if (Input.GetKeyDown(KeyCode.Return) ||
                Input.GetKeyDown(KeyCode.Space))
            {
                video.Play();
                timeline.Resume();
                pauseMenu.SetActive(false);
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                SceneManager.LoadScene(sceneName);
            }
        }
        else
        {
            //Video is playing
            if (Input.GetKeyDown(KeyCode.Escape) ||
                Input.GetKeyDown(KeyCode.Space) ||
                Input.GetKeyDown(KeyCode.Return))
            {
                video.Pause();
                timeline.Pause();
                pauseMenu.SetActive(true);
            }
        }
    }
Example #14
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(playKeyCode))
     {
         if (warpTime)
         {
             PlayAtSpeed(director, timeScale);
             //director.SetSpeed(timeScale);
         }
         else
         {
             director.Play();
         }
     }
     if (Input.GetKeyDown(pauseKeyCode))
     {
         director.Pause();
     }
     if (Input.GetKeyDown(stopKeyCode))
     {
         director.Stop();
     }
     if (Input.GetKeyDown(resumeKeyCode))
     {
         director.Resume();
     }
 }
Example #15
0
 public void ResumeEffect()
 {
     if (m_currEfect != null)
     {
         m_director.Resume();
     }
 }
Example #16
0
        // Changes the state of the cutscene if it can
        // Can etiehr accept: Resume, Pause, Stop
        public void ChangeCutsceneState(string state)
        {
            switch (state)
            {
            case "Resume":
                if (cutsceneObject.state == PlayState.Paused)
                {
                    cutsceneObject.Resume();
                }
                break;

            case "Pause":
                if (cutsceneObject.state == PlayState.Playing)
                {
                    cutsceneObject.Pause();
                }
                break;

            case "Stop":
                if (cutsceneObject.state == PlayState.Playing)
                {
                    cutsceneObject.Stop();
                }
                break;

            default:
                Debug.LogError("I don't know what " + state + " is!");
                break;
            }
        }
Example #17
0
    void SkipDialog() // c'est une fonction
    {
        if (childIndex == 0)
        {
            Debug.Log(Dialog[Index].transform.GetChild(childIndex));
            Dialog[Index].transform.GetChild(childIndex).gameObject.SetActive(true); //on appelle un enfant

            childIndex += 1;                                                         // on incrémente
        }

        else if (childIndex != 0)
        {
            if (childIndex == (Dialog[Index].transform.childCount)) // si on arrive au maximum du nbr d'enfant (childCount)
            {
                Dialog[Index].transform.GetChild(childIndex - 1).gameObject.SetActive(false);


                childIndex = 0;    // On réinitialise le childIndex pour qu'il puisse recommencer de compter
                Index     += 1;    // On passe au parent suivant (le gros truc qui regroupe tout les enfants dialog Box)
                Debug.Log("Je suis la");
                Timeline.Resume(); //Resume est une fonction donc y'a des ()
                canSkip   = false;
                isplaying = false;
            }

            else //else a pas besoin de parenthese
            {
                Dialog[Index].transform.GetChild(childIndex - 1).gameObject.SetActive(false); // on chercher l'enfant -1
                Dialog[Index].transform.GetChild(childIndex).gameObject.SetActive(true); // enfant actuel (pas besoin de mettre + 1)

                childIndex += 1;                                                         //on incrémente encore.
            }
        }
    }
Example #18
0
        private void StartAnimation(CharacterAnimationInfo animationInfo, Action onComplete = null, Action onCancel = null, bool restart = true, bool async = false)
        {
            //IL_0030: Unknown result type (might be due to invalid IL or missing references)
            //IL_0046: Unknown result type (might be due to invalid IL or missing references)
            string animationName = animationInfo.animationName;
            string timelineKey   = animationInfo.timelineKey;

            m_animator2D.get_transform().set_localRotation(animationInfo.flipX ? Quaternion.Euler(0f, -135f, 0f) : Quaternion.Euler(0f, 45f, 0f));
            direction = animationInfo.direction;
            ITimelineAssetProvider characterData = m_characterData;

            if (characterData != null)
            {
                TimelineAsset timelineAsset;
                bool          flag = characterData.TryGetTimelineAsset(timelineKey, out timelineAsset);
                if (flag && null != timelineAsset)
                {
                    if (timelineAsset != m_playableDirector.get_playableAsset())
                    {
                        m_playableDirector.Play(timelineAsset);
                    }
                    else
                    {
                        if (restart || !m_animator2D.get_animationName().Equals(animationName))
                        {
                            m_playableDirector.set_time(0.0);
                        }
                        m_playableDirector.Resume();
                    }
                    m_hasTimeline = true;
                }
                else
                {
                    if (flag)
                    {
                        Log.Warning("Character named '" + m_characterData.get_name() + "' has a timeline setup for key '" + timelineKey + "' but the actual asset is null.", 323, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\HavreMap\\MapPathfindingActor.cs");
                    }
                    m_playableDirector.set_time(0.0);
                    m_playableDirector.Pause();
                    m_hasTimeline = false;
                }
            }
            m_animationCallback.Setup(animationName, restart, onComplete, onCancel);
            m_animator2D.SetAnimation(animationName, animationInfo.loops, async, restart);
            m_animationParameters = animationInfo.parameters;
        }
Example #19
0
        public void CineNext()
        {
            playableDirector.Resume();

            var sound = MCSoundManager.Instance.objectSound.ui;

            sound.PlaySound(this.gameObject, sound.nextPage);
        }
Example #20
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space) && isPreTrainingEnd == true)
     {
         mainTrainingTimeline.Play();
         movieTimeline.Resume();
         StartCoroutine(DelayFunction());
     }
 }
Example #21
0
    void ResumeCurrentlyPausedPlayableDirector()
    {
        if (currentlyPausedPlayableDirector != null)
        {
            currentlyPausedPlayableDirector.Resume();
        }

        onUpdateAction = null;
        currentlyPausedPlayableDirector = null;
    }
Example #22
0
        public void OnTalkFinished(Talk t, bool succeeded)
        {
            if (!m_exporting || !talk.Equals(t))
            {
                return;
            }

            if (!succeeded)
            {
                m_exporting = false;

                // on 2017.x, director.time can be advanced by delta time
                if (m_timePaused != NullTime && Math.Abs(director.time - m_timePaused) < MaxAllowedDelta)
                {
                    director.Resume();
                }
                m_timePaused = NullTime;
            }
        }
Example #23
0
 private void Next()
 {
     Debug.Log($"{this}: start sailing {context.Boat.Speed}");
     context.Boat.SetDrift(-.125f);
     context.SetSailToAssignmentState(context.AssignmentIndex + 1);
     if (turtleTimeline.state != PlayState.Playing)
     {
         turtleTimeline.Resume();
     }
 }
Example #24
0
        public void Update()
        {
            TimelineInfo timelineInfoToDestroy = null;

            if (mPlayingTimeline != null)
            {
                PlayableDirector playableDirector = mPlayingTimeline.PlayableDirector;
                if (playableDirector != null && playableDirector.isActiveAndEnabled)
                {
                    //GameDebug.LogError("playableDirector.state: " + playableDirector.state.ToString()
                    //    + ", playableDirector.time: " + playableDirector.time
                    //    + ", playableDirector.duration: " + playableDirector.duration);
                    if (playableDirector.state == PlayState.Paused)
                    {
                        if (playableDirector.time > 0f) // 暂停状态下,如果已经走了一段时间则算是播放结束
                        {
                            timelineInfoToDestroy = mPlayingTimeline;
                        }
                        else  // 否则需要恢复播放
                        {
                            playableDirector.Resume();
                        }
                    }
                    else if (playableDirector.time >= playableDirector.duration)    // 时间大于等于总时间,则算是播放结束
                    {
                        timelineInfoToDestroy = mPlayingTimeline;
                    }
                }
            }
            if (timelineInfoToDestroy != null)
            {
                StopImpl(timelineInfoToDestroy);

                // 播放缓存下来的动画
                if (mCacheTimelineList.Count > 0)
                {
                    TimelineInfo cacheTimelineInfo = mCacheTimelineList.Dequeue();
                    PlayImpl(cacheTimelineInfo);
                }
                else
                {
                    if (mAllFinishCallbacks.Count > 0)
                    {
                        foreach (System.Action finishCallback in mAllFinishCallbacks)
                        {
                            if (finishCallback != null)
                            {
                                finishCallback();
                            }
                        }
                        mAllFinishCallbacks.Clear();
                    }
                }
            }
        }
 public void ProcessInputFromCurrentState()
 {
     if (currentScriptedAction == Enums.ScriptActionType.ReadDialogueWaitForInput)
     {
         Debug.Log("Recieved Input While Waiting");
     }
     if (currentScriptedAction == Enums.ScriptActionType.WaitForChoice)
     {
         director.Resume();
     }
 }
Example #26
0
    private void Update()
    {
        if (Input.anyKeyDown)
        {
            timelinePlaytime += keystrokePlaytAddAmt;
        }

        if (timelinePlaytime > 0)
        {
            if (playableDirector.state == PlayState.Paused)
            {
                playableDirector.Resume();
            }
            timelinePlaytime -= Time.deltaTime;
        }
        else
        {
            playableDirector.Pause();
        }
    }
        void timelineAction()
        {
            var go = Fsm.GetOwnerDefaultTarget(gameObject);

            if (go == null || timeline == null)
            {
                return;
            }

            timeline.Resume();
        }
Example #28
0
        public void ClearMarker(string markerName)
        {
            if (_actions.ContainsKey(markerName) &&
                _actions[markerName] == Action.Pause &&
                TestMarker(markerName, MarkerTest.InsideMarker))
            {
                _director.Resume();
            }

            _actions[markerName] = Action.None;
        }
Example #29
0
    void ButtonPlayTimeline()
    {
        Debug.Log("Play timeline");
        playableDirector.Play();

        if (pause == true)
        {
            playableDirector.Resume();
            pause = false;
        }
    }
Example #30
0
    IEnumerator Play()
    {
        _playState = EPlay.Play;
        yield return(Node.Run());

        _playState = EPlay.Over;
        if (_waitPlay)
        {
            _waitPlay = false;
            Director.Resume();
        }
    }