Ejemplo n.º 1
0
        private static void tweakerSendEvent([NamedToggleValue(typeof(StateMachineContextNameGenerator), 0u)] string contextName, [NamedToggleValue(typeof(StateMachineNameGenerator), 0u)] string targetString, string eventString)
        {
            StateMachineContext stateMachineContext = null;

            StateMachineContext[] array = UnityEngine.Object.FindObjectsOfType <StateMachineContext>();
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i].name == contextName)
                {
                    stateMachineContext = array[i];
                    break;
                }
            }
            if (stateMachineContext != null)
            {
                if (stateMachineContext.ContainsStateMachine(targetString))
                {
                    stateMachineContext.SendEvent(new ExternalEvent(targetString, eventString));
                    return;
                }
                Log.LogErrorFormatted(typeof(StateMachineContext), "StateMachineContext {0} does not contain StateMachine {1}", contextName, targetString);
            }
            else
            {
                Log.LogErrorFormatted(typeof(StateMachineContext), "Could not find a StateMachineContext with name {0}", contextName);
            }
        }
Ejemplo n.º 2
0
        private int dependentStateMachineCount(IList <string> targetFilters)
        {
            int num = 0;

            for (int i = 0; i < targetFilters.Count; i++)
            {
                if (context.ContainsStateMachine(targetFilters[i]))
                {
                    num++;
                }
            }
            return(num);
        }