static public int constructor(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.Playables.FrameData o; o = new UnityEngine.Playables.FrameData(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
public override void PrepareFrame(Playable playable, UnityEngine.Playables.FrameData info) { if ((UnityEngine.Object) this.director == (UnityEngine.Object)null || !this.director.isActiveAndEnabled || (UnityEngine.Object) this.director.playableAsset == (UnityEngine.Object)null) { return; } if (this.director.playableGraph.IsValid()) { int rootPlayableCount = this.director.playableGraph.GetRootPlayableCount(); for (int index = 0; index < rootPlayableCount; ++index) { Playable rootPlayable = this.director.playableGraph.GetRootPlayable(index); if (rootPlayable.IsValid <Playable>()) { rootPlayable.SetSpeed <Playable>((double)info.effectiveSpeed); for (int i = 0; i < rootPlayable.GetInputCount(); i++) { rootPlayable.SetInputWeight(i, info.effectiveWeight); } } } } this.m_Time = playable.GetTime <Playable>(); this.UpdateTime(playable); }
public override void OnBehaviourPause(Playable playable, UnityEngine.Playables.FrameData info) { if (!((UnityEngine.Object) this.director != (UnityEngine.Object)null) || !((UnityEngine.Object) this.director.playableAsset != (UnityEngine.Object)null)) { return; } this.director.Pause(); }
public override void OnBehaviourPlay(Playable playable, UnityEngine.Playables.FrameData info) { if (!((UnityEngine.Object) this.director != (UnityEngine.Object)null) || !((UnityEngine.Object) this.director.playableAsset != (UnityEngine.Object)null)) { return; } this.UpdateTime(playable); this.director.Evaluate(); this.director.Play(); }
//---------------------------------------------------------------------------- // PlayableGraphのProcessFrameフェーズの間に呼び出される // ProcessFrameはあなたのPlayableがその仕事をする段階です。 // PlayableがPlayPlayableOutputを直接または間接的に再生して接続するときに、各フレームに対して呼び出されます。 public override void ProcessFrame( UnityEngine.Playables.Playable playable, UnityEngine.Playables.FrameData info, object playerData ) { if (Application.isPlaying) { luaUpdate?.Invoke(); } }
//---------------------------------------------------------------------------- // PlayState.Pausedに変更されたときに呼び出される public override void OnBehaviourPause( UnityEngine.Playables.Playable playable, UnityEngine.Playables.FrameData info ) { luaOnDestroy?.Invoke(); luaOnDestroy = null; scriptEnv?.Dispose(); scriptEnv = null; luaUpdate = null; }
static public int constructor(IntPtr l) { try { UnityEngine.Playables.FrameData o; o = new UnityEngine.Playables.FrameData(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
//---------------------------------------------------------------------------- // PlayState.Playingに変更されたときに呼び出される public override void OnBehaviourPlay( UnityEngine.Playables.Playable playable, UnityEngine.Playables.FrameData info ) { if (textAsset != null) { scriptEnv = LuaEngine.LuaEnv.NewTable(); // スクリプトごとに別々の環境を設定すると、スクリプト間でのグローバル変数と関数の競合をある程度防ぐことができます。 XLua.LuaTable meta = LuaEngine.LuaEnv.NewTable(); meta.Set("__index", LuaEngine.LuaEnv.Global); scriptEnv.SetMetaTable(meta); meta.Dispose(); scriptEnv.Set("self", owner); LuaEngine.LuaEnv.DoString(textAsset.text, textAsset.GetHashCode().ToString(), scriptEnv); Action luaAwake = scriptEnv.Get <Action>("awake"); scriptEnv.Get("update", out luaUpdate); scriptEnv.Get("ondestroy", out luaOnDestroy); luaAwake?.Invoke(); } }