コード例 #1
0
 internal ImmediateAnimation(Animator animator, bool unscaledTime = false)
 {
     graph     = PlayableGraph.Create();
     timeScale = unscaledTime ? DirectorUpdateMode.UnscaledGameTime : DirectorUpdateMode.GameTime;
     graph.SetTimeUpdateMode(timeScale);
     output = AnimationPlayableOutput.Create(graph, "ImmediateAnimation", animator);
 }
コード例 #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;
                }
            }
コード例 #3
0
 public bool PlayFadeOutEffect(DirectorUpdateMode a_eUpdateMode, UnityAction <string> a_onFinished = null)
 {
     if (fadeOutEffect != null && fadeOutEffect.IsValid())
     {
         return(_PlayEffect(fadeOutEffect, DirectorWrapMode.None, a_eUpdateMode, a_onFinished));
     }
     return(false);
 }
    private static int SetTimeUpdateMode(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 2);
            DirectorPlayer     directorPlayer = (DirectorPlayer)ToLua.CheckObject(L, 1, typeof(DirectorPlayer));
            DirectorUpdateMode timeUpdateMode = (int)ToLua.CheckObject(L, 2, typeof(DirectorUpdateMode));
            directorPlayer.SetTimeUpdateMode(timeUpdateMode);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    private static int GetTimeUpdateMode(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            DirectorPlayer     directorPlayer = (DirectorPlayer)ToLua.CheckObject(L, 1, typeof(DirectorPlayer));
            DirectorUpdateMode timeUpdateMode = directorPlayer.GetTimeUpdateMode();
            ToLua.Push(L, timeUpdateMode);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    public static int GetTimeUpdateMode(IntPtr l)
    {
        int result;

        try
        {
            PlayableGraph playableGraph;
            LuaObject.checkValueType <PlayableGraph>(l, 1, out playableGraph);
            DirectorUpdateMode timeUpdateMode = playableGraph.GetTimeUpdateMode();
            LuaObject.pushValue(l, true);
            LuaObject.pushEnum(l, (int)timeUpdateMode);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #7
0
        public void PlayEffect(string a_strEffectName, DirectorWrapMode a_eWrapMode, DirectorUpdateMode a_eUpdateMode, UnityAction <string> a_onFinished = null)
        {
            GuiEffect guiEffect = null;

            for (int i = 0; i < commonEffects.Count; ++i)
            {
                if (commonEffects[i].strName == a_strEffectName)
                {
                    guiEffect = commonEffects[i];
                    break;
                }
            }

            if (guiEffect == null)
            {
                return;
            }

            _PlayEffect(guiEffect, a_eWrapMode, a_eUpdateMode, a_onFinished);
        }
コード例 #8
0
ファイル: SingleAnimation.cs プロジェクト: r-kajiya/Framework
        public void Initialize(DirectorUpdateMode updateMode = DirectorUpdateMode.GameTime)
        {
            _isInitialized = false;
            _updateMode    = updateMode;

            if (_playableGraph.IsValid())
            {
                _playableGraph.Destroy();
            }

            _playableGraph = PlayableGraph.Create();
            _playableGraph.SetTimeUpdateMode(_updateMode);

            _animationClipPlayable = AnimationClipPlayable.Create(_playableGraph, _animationClip);
            _animationClipPlayable.SetApplyFootIK(false);
            _animationClipPlayable.SetApplyPlayableIK(false);

            var playableOutput = AnimationPlayableOutput.Create(_playableGraph, "SingleAnimation", Animator);

            playableOutput.SetSourcePlayable(_animationClipPlayable);

            _isInitialized = true;
        }
コード例 #9
0
 public void SetTimeUpdateMode(DirectorUpdateMode mode)
 {
     throw new NotImplementedException("なにこれ");
 }
コード例 #10
0
ファイル: DirectorPlayer.cs プロジェクト: randomize/VimConfig
 public extern void SetTimeUpdateMode(DirectorUpdateMode mode);
コード例 #11
0
 private static extern void SetTimeUpdateMode_Injected(ref PlayableGraph _unity_self, DirectorUpdateMode value);
コード例 #12
0
 public void SetTimeUpdateMode(DirectorUpdateMode value)
 {
     PlayableGraph.SetTimeUpdateMode_Injected(ref this, value);
 }
コード例 #13
0
 extern public void SetTimeUpdateMode(DirectorUpdateMode value);
コード例 #14
0
ファイル: SingleAnimation.cs プロジェクト: r-kajiya/Framework
 public void Reset(AnimationClip animationClip, DirectorUpdateMode updateMode = DirectorUpdateMode.GameTime)
 {
     _animationClip = animationClip;
     Initialize(updateMode);
 }
コード例 #15
0
 public void SetTimeUpdateMode(DirectorUpdateMode mode);
コード例 #16
0
 public extern void SetTimeUpdateMode(DirectorUpdateMode mode);
コード例 #17
0
 private static void SetUpdateModeInternal(ref PlayableGraph graph, DirectorUpdateMode mode)
 {
     PlayableGraph.INTERNAL_CALL_SetUpdateModeInternal(ref graph, mode);
 }
コード例 #18
0
 public void SetTimeUpdateMode(DirectorUpdateMode value)
 {
     PlayableGraph.SetUpdateModeInternal(ref this, value);
 }
コード例 #19
0
 public void SetTimeUpdateMode(DirectorUpdateMode value)
 {
     graph.SetTimeUpdateMode(value);
 }
コード例 #20
0
        protected bool _PlayEffect(GuiEffect a_guiEffect, DirectorWrapMode a_eWrapMode, DirectorUpdateMode a_eUpdateMode, UnityAction <string> a_onFinished)
        {
            if (a_guiEffect == null || a_guiEffect.timelineAsset == null || m_objOwner.activeInHierarchy == false)
            {
                return(false);
            }

            m_director.Stop();

            m_director.extrapolationMode = a_eWrapMode;
            m_director.initialTime       = 0;
            m_director.timeUpdateMode    = a_eUpdateMode;

            m_director.Play(a_guiEffect.timelineAsset);
            m_currEfect = a_guiEffect;
            m_currEfect.onFinished.AddListener(a_onFinished);

            return(true);
        }
コード例 #21
0
 private static extern void INTERNAL_CALL_SetUpdateModeInternal(ref PlayableGraph graph, DirectorUpdateMode mode);
コード例 #22
0
 public void SetTimeUpdateMode(DirectorUpdateMode mode);
コード例 #23
0
 public void SetTimeUpdateMode(DirectorUpdateMode mode)
 {
     graph.SetTimeUpdateMode(mode);
 }
コード例 #24
0
 public void SetTimeUpdateMode(DirectorUpdateMode mode)
 {
     director.timeUpdateMode = mode;
 }