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); }
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; } }
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); }
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); }
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; }
public void SetTimeUpdateMode(DirectorUpdateMode mode) { throw new NotImplementedException("なにこれ"); }
public extern void SetTimeUpdateMode(DirectorUpdateMode mode);
private static extern void SetTimeUpdateMode_Injected(ref PlayableGraph _unity_self, DirectorUpdateMode value);
public void SetTimeUpdateMode(DirectorUpdateMode value) { PlayableGraph.SetTimeUpdateMode_Injected(ref this, value); }
extern public void SetTimeUpdateMode(DirectorUpdateMode value);
public void Reset(AnimationClip animationClip, DirectorUpdateMode updateMode = DirectorUpdateMode.GameTime) { _animationClip = animationClip; Initialize(updateMode); }
public void SetTimeUpdateMode(DirectorUpdateMode mode);
private static void SetUpdateModeInternal(ref PlayableGraph graph, DirectorUpdateMode mode) { PlayableGraph.INTERNAL_CALL_SetUpdateModeInternal(ref graph, mode); }
public void SetTimeUpdateMode(DirectorUpdateMode value) { PlayableGraph.SetUpdateModeInternal(ref this, value); }
public void SetTimeUpdateMode(DirectorUpdateMode value) { graph.SetTimeUpdateMode(value); }
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); }
private static extern void INTERNAL_CALL_SetUpdateModeInternal(ref PlayableGraph graph, DirectorUpdateMode mode);
public void SetTimeUpdateMode(DirectorUpdateMode mode) { graph.SetTimeUpdateMode(mode); }
public void SetTimeUpdateMode(DirectorUpdateMode mode) { director.timeUpdateMode = mode; }