Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     // If instance is initialized
     if (bot != null)
     {
         bool triggerbool = true;
         // Every considered setting must be "1"
         foreach (GameObject setting in SettingsToCheck)
         {
             // Does setting exist?
             if (setting != null)
             {
                 if (bot.GetGlobalSetting(setting.name) != "1")
                 {
                     triggerbool = false;
                 }
             }
         }
         // Settings that must be "0"
         foreach (GameObject setting in SettingsMustNotBeTriggered)
         {
             // Does setting exist?
             if (setting != null)
             {
                 if (bot.GetGlobalSetting(setting.name) == "1")
                 {
                     triggerbool = false;
                 }
             }
         }
         if (triggerbool)
         {
             foreach (GameObject tmpMessageReciever in MessageReciever)
             {
                 // Does tmpMessageReciever exist?
                 if (tmpMessageReciever)
                 {
                     bot.TriggerFromHelperfunction(tmpMessageReciever.name);
                 }
             }
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Just call Triggerfunction in Chatbot.core and
 /// pass trigger name as string.
 /// </summary>
 /// <param name="triggername">Triggername.</param>
 public void TriggerFromHelperfunction(string triggername)
 {
     // Call function and pass trigger name.
     bot.TriggerFromHelperfunction(triggername);
 }