/// <summary>
 /// Create a new method events. Populates these triggerable events into an Event Method Listener, by binding them just like delegates.
 /// </summary>
 /// <param name="name">The name of this Method Event.</param>
 public MethodEvent(string @name, IGraph @graph, GameObject @gameobject, int eventId, AotDictionary arguments)
 {
     this.@name      = @name;
     instanceId      = new object().GetHashCode();
     methodEventData = new AotDictionary();
     methodEventData.Add("name", @name);
     methodEventData.Add("instanceId", instanceId);
     methodEventData.Add("graph", @graph);
     methodEventData.Add("gameObject", @gameobject);
     methodEventData.Add("arguments", @arguments);
     methodEventData.Add("eventId", eventId);
 }
Exemplo n.º 2
0
        public IDictionary Merge(Flow flow)
        {
            var dictionary = new AotDictionary();

            for (var i = 0; i < inputCount; i++)
            {
                var inputDictionary = flow.GetValue <IDictionary>(multiInputs[i]);

                var enumerator = inputDictionary.GetEnumerator();

                while (enumerator.MoveNext())
                {
                    if (!dictionary.Contains(enumerator.Key))
                    {
                        dictionary.Add(enumerator.Key, enumerator.Value);
                    }
                }
            }

            return(dictionary);
        }
Exemplo n.º 3
0
    public void start_KeywordRecognizer(AotDictionary dic)
    {
        int max = dic.Count;

        string[] aKey   = new string[max];
        string[] aValue = new string[max];
        Array.Resize(ref VoiceKeyword, max);

        ICollection k = dic.Keys;
        ICollection v = dic.Values;

        k.CopyTo(VoiceKeyword, 0);
        k.CopyTo(aKey, 0);
        v.CopyTo(aValue, 0);

        for (int i = 0; i < max; i++)
        {
            VoiceKeyCmd.Add(aKey[i], aValue[i]);
        }

        m_Recognizer = new KeywordRecognizer(VoiceKeyword);
        m_Recognizer.OnPhraseRecognized += OnPhraseRecognized; // 音声認識時のコールバック設定
        m_Recognizer.Start();                                  // 音声認識開始
    }
 public MainWindow()
 {
     InitializeComponent();
     AotMorph = new AotDictionary(@"..\..");
 }
 public void AttachMethodEvent(MethodEvent @methodEvent, AotDictionary arguments)
 {
     methodEvent.methodEventData["arguments"] = arguments;
     methodEvents.Add(methodEvent);
 }