Exemplo n.º 1
0
 static string GetFilePath(TwitchAlertsType type)
 {
     if (type.IsDeepBot())
     {
         return(deepBotPath + type + extension);
     }
     else
     {
         return(twitchAlertsPath + type.ToString().Replace("thirty_", "30") + extension);
     }
 }
Exemplo n.º 2
0
    void Process()
    {
        lastUpdated = Time.realtimeSinceStartup;
        string line = ReadFile(GetFilePath(type));

        if (lastValue != line)
        {
            if (text != null)
            {
                text.text = PostProcess(line);
            }
            if (textWrapper != null)
            {
                textWrapper.text = PostProcess(line);
            }

            //Broadcast change
            if (Messenger.eventTable.ContainsKey(type.ToString()))
            {
                Messenger.Broadcast(type.ToString(), AlertData.Parse(type, prepend + line + append), lastValue == null);
            }
        }
        lastValue = line;
    }