mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 12:33:02 +00:00
32 lines
666 B
C#
32 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);
|
|
}
|
|
|
|
}
|
|
|
|
}
|