예제 #1
0
        /// <summary>
        /// Adds a new transition that can happen from any possible state
        /// </summary>
        /// <param name="transition">The transition instance; The "from" field can be
        /// left empty, as it has no meaning in this context.</param>
        public void AddTransitionFromAny(TransitionBase transition)
        {
            transition.fsm  = this;
            transition.mono = mono;

            transition.Init();

            transitionsFromAny.Add(transition);
        }
예제 #2
0
        /// <summary>
        /// Adds a new transition between two states
        /// </summary>
        /// <param name="transition">The transition instance</param>
        public void AddTransition(TransitionBase transition)
        {
            if (!fromNameToTransitions.ContainsKey(transition.from))
            {
                fromNameToTransitions[transition.from] = new List <TransitionBase>();
            }

            transition.fsm  = this;
            transition.mono = mono;

            transition.Init();

            fromNameToTransitions[transition.from].Add(transition);
        }