mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-27 14:30:17 +00:00
33 lines
666 B
C#
33 lines
666 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
namespace SanAndreasUnity.UI
|
|||
|
{
|
|||
|
|
|||
|
public class ChatInputController : MonoBehaviour
|
|||
|
{
|
|||
|
public InputField inputField;
|
|||
|
public Button sendButton;
|
|||
|
|
|||
|
|
|||
|
void Start()
|
|||
|
{
|
|||
|
this.sendButton.onClick.AddListener(() => SendChatMessage(this.inputField.text));
|
|||
|
}
|
|||
|
|
|||
|
void SendChatMessage(string msg)
|
|||
|
{
|
|||
|
this.inputField.text = "";
|
|||
|
|
|||
|
if (string.IsNullOrWhiteSpace(msg))
|
|||
|
return;
|
|||
|
|
|||
|
Chat.ChatManager.SendChatMessageToAllPlayersAsLocalPlayer(msg);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|