Пример #1
0
    private void UpdateClientChat(string message, ChatChannel channels)
    {
        if (string.IsNullOrEmpty(message))
        {
            return;
        }

        trySendingTTS(message);

        if (PlayerManager.LocalPlayerScript == null)
        {
            channels = ChatChannel.OOC;
        }

        if (channels != ChatChannel.None)
        {
            // replace action messages with chat bubble
            if (channels.HasFlag(ChatChannel.Combat) || channels.HasFlag(ChatChannel.Action) || channels.HasFlag(ChatChannel.Examine))
            {
                string cleanMessage = Regex.Replace(message, "<.*?>", string.Empty);
                if (cleanMessage.StartsWith("You"))
                {
                    ChatBubbleManager.ShowAChatBubble(PlayerManager.LocalPlayerScript.transform, Regex.Replace(message, "<.*?>", string.Empty));
                    return;
                }
            }

            ChatUI.Instance.AddChatEntry(message);
        }
    }
Пример #2
0
 private void Speak(string text)
 {
     //TODO use the actual chat api when it allows it!
     Chat.AddLocalMsgToChat($"<b>{capParrotName} says</b>, \"{text}\"",
                            gameObject.transform.position,
                            gameObject);
     ChatBubbleManager.ShowAChatBubble(gameObject.transform, text);
 }
Пример #3
0
 private void Speak(string text)
 {
     //TODO use the actual chat api when it allows it!
     Chat.AddLocalMsgToChat(
         text,
         gameObject,
         MobName);
     ChatBubbleManager.ShowAChatBubble(gameObject.transform, text);
 }
        public override void Process(NetMessage msg)
        {
            LoadNetworkObject(msg.FollowTransform);
            var target = NetworkObject.transform;

            if (msg.IsPlayerChatBubble)
            {
                target = target.GetComponent <PlayerNetworkActions>().chatBubbleTarget;
            }

            ChatBubbleManager.ShowAChatBubble(target, msg.Message, msg.ChatModifiers);
        }
    public bool IsPlayerChatBubble;     //Special flag for finding the correct transform target on players
    //You may have to do something like this if your target does not
    //have a NetworkIdentity on it

    public override IEnumerator Process()
    {
        yield return(WaitFor(FollowTransform));

        var target = NetworkObject.transform;

        if (IsPlayerChatBubble)
        {
            target = target.GetComponent <PlayerNetworkActions>().chatBubbleTarget;
        }

        ChatBubbleManager.ShowAChatBubble(target, Message, ChatModifiers);
    }