コード例 #1
0
 public void OnPrepareFrame(Listener_EventArgs e)
 {
     if (m_prepareFrame != null)
     {
         m_prepareFrame.Invoke();
     }
     if (m_prepareFrameEventHandle != null)
     {
         m_prepareFrameEventHandle(this, e);
     }
 }
コード例 #2
0
 public void OnGraphStop(Listener_EventArgs e)
 {
     if (m_graphStop != null)
     {
         m_graphStop.Invoke();
     }
     if (m_graphStopEventHandle != null)
     {
         m_graphStopEventHandle(this, e);
     }
 }
コード例 #3
0
 public void OnGraphStart(Listener_EventArgs e)
 {
     if (m_graphStart != null)
     {
         m_graphStart.Invoke();
     }
     if (m_graphStartEventHandle != null)
     {
         m_graphStartEventHandle(this, e);
     }
 }
コード例 #4
0
 public void OnBehaviourPause(Listener_EventArgs e)
 {
     if (m_behaviourPause != null)
     {
         m_behaviourPause.Invoke();
     }
     if (m_behaviourPauseEventHandle != null)
     {
         m_behaviourPauseEventHandle(this, e);
     }
 }
コード例 #5
0
 public void OnBehaviourPlay(Listener_EventArgs e)
 {
     if (m_behaviourPlay != null)
     {
         m_behaviourPlay.Invoke();
     }
     if (m_behaviourPlayEventHandle != null)
     {
         m_behaviourPlayEventHandle(this, e);
     }
 }
コード例 #6
0
        public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
        {
            var playable = ScriptPlayable <KaiTool_PlayableBehaviour> .Create(graph);

            var listener = m_eventListener.Resolve(graph.GetResolver());

            playable.GetBehaviour().m_behaviourPlayEventHandle += (sender, e) =>
            {
                if (listener)
                {
                    var args = new Listener_EventArgs();
                    args.m_playable = e.m_playable;
                    args.m_info     = e.m_info;
                    listener.OnBehaviourPlay(args);
                }
            };
            playable.GetBehaviour().m_behaviourPauseEventHandle += (sender, e) =>
            {
                // var listener = m_eventListener.Resolve(graph.GetResolver());
                if (listener != null)
                {
                    var args = new Listener_EventArgs();
                    args.m_playable = e.m_playable;
                    args.m_info     = e.m_info;
                    listener.OnBehaviourPause(args);
                }
            };
            playable.GetBehaviour().m_graphStartEventHandle += (sender, e) =>
            {
                // var listener = m_eventListener.Resolve(graph.GetResolver());
                if (listener)
                {
                    var args = new Listener_EventArgs();
                    args.m_playable = e.m_playable;
                    args.m_info     = e.m_info;
                    listener.OnGraphStart(args);
                }
            };
            playable.GetBehaviour().m_graphStopEventHandle += (sender, e) =>
            {
                //var listener = m_eventListener.Resolve(graph.GetResolver());
                if (listener)
                {
                    var args = new Listener_EventArgs();
                    args.m_playable = e.m_playable;
                    args.m_info     = e.m_info;
                    listener.OnGraphStop(args);
                }
            };
            playable.GetBehaviour().m_prepareFrameEventHandle += (sender, e) =>
            {
                // var listener = m_eventListener.Resolve(graph.GetResolver());
                if (listener)
                {
                    var args = new Listener_EventArgs();
                    args.m_playable = e.m_playable;
                    args.m_info     = e.m_info;
                    listener.OnPrepareFrame(args);
                }
            };
            return(playable);
        }