Пример #1
0
 public static void Message(string text, MessageTypeDef type)
 {
     if (!Messages.AcceptsMessage(text, TargetInfo.Invalid))
     {
         return;
     }
     Messages.LiveMessage msg = new Messages.LiveMessage(text);
     Messages.Message(msg, type);
 }
Пример #2
0
 public static void Message(string text, GlobalTargetInfo lookTarget, MessageTypeDef type)
 {
     if (!Messages.AcceptsMessage(text, lookTarget))
     {
         return;
     }
     Messages.LiveMessage msg = new Messages.LiveMessage(text, lookTarget);
     Messages.Message(msg, type);
 }
Пример #3
0
 private static void Message(Messages.LiveMessage msg, MessageTypeDef type)
 {
     Messages.liveMessages.Add(msg);
     while (Messages.liveMessages.Count > 12)
     {
         Messages.liveMessages.RemoveAt(0);
     }
     if (type.sound != null)
     {
         type.sound.PlayOneShotOnCamera(null);
     }
 }
Пример #4
0
        public static bool CollidesWithAnyMessage(Rect rect, out float messageAlpha)
        {
            bool  result = false;
            float num    = 0f;

            for (int i = 0; i < Messages.liveMessages.Count; i++)
            {
                Messages.LiveMessage liveMessage = Messages.liveMessages[i];
                if (rect.Overlaps(liveMessage.lastDrawRect))
                {
                    result = true;
                    num    = Mathf.Max(num, liveMessage.Alpha);
                }
            }
            messageAlpha = num;
            return(result);
        }