Пример #1
0
        private void OnFsmBreakpointSet(BaseFsm fsm, object state)
        {
            #if PLAYMAKER
            var pair = GetTrackingPair(fsm);
            if (pair == null || pair.view == null)
            {
                return;
            }

            // Been set from code so update PlayMaker
            if (!pair.settingPlayMakerBreakpoint)
            {
                var targetStateName = pair.fsmIntrospection.StateFromEnumState(state);

                foreach (var fsmState in pair.view.FsmStates)
                {
                    if (fsmState.Name == targetStateName)
                    {
                        pair.currentEnterBreakpoints.Add(fsmState);
                        fsmState.IsBreakpoint = true;
                    }
                }
            }
            #endif

            if (WantRepaint != null)
            {
                WantRepaint();
            }
        }
Пример #2
0
        private TrackingPair GetTrackingPair(BaseFsm fsm)
        {
            if (tracking == null)
            {
                return(null);
            }

            foreach (var pair in tracking)
            {
                if (pair.targetFsm == fsm)
                {
                    return(pair);
                }
            }

            return(null);
        }
Пример #3
0
        private void OnFsmBreakpointHit(BaseFsm fsm, object state)
        {
            #if PLAYMAKER
            var pair = GetTrackingPair(fsm);
            if (pair == null || pair.view == null)
            {
                return;
            }

            // Force update UI
            if (pair.view != null)
            {
                var currentFsmState = pair.fsmIntrospection.State;
                pair.view.SetState(currentFsmState);
                pair.view.Fsm.Update();
                if (WantRepaint != null)
                {
                    WantRepaint();
                }
            }
            #endif
        }
Пример #4
0
        private void OnFsmBreakpointsReset(BaseFsm fsm)
        {
            #if PLAYMAKER
            var pair = GetTrackingPair(fsm);
            if (pair == null || pair.view == null)
            {
                return;
            }

            // Been set from code so update PlayMaker
            if (!pair.settingPlayMakerBreakpoint)
            {
                foreach (var state in pair.view.FsmStates)
                {
                    state.IsBreakpoint = false;
                }

                if (WantRepaint != null)
                {
                    WantRepaint();
                }
            }
            #endif
        }