add UI and logic UI
This commit is contained in:
@@ -72,6 +72,8 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
private void OnDestroy()
|
||||
{
|
||||
EventBus.Unsubscribe<WhisperPlayerEvent>(OnWhisperPlayerEvent);
|
||||
if (inputField != null)
|
||||
inputField.onSubmit.RemoveListener(OnSubmit);
|
||||
}
|
||||
|
||||
private void OnWhisperPlayerEvent(WhisperPlayerEvent e)
|
||||
@@ -81,7 +83,9 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
|
||||
private void Start()
|
||||
{
|
||||
inputField.onSubmit.AddListener(OnSubmit);
|
||||
// PC / Editor: Enter submits. Android: only sendButton → SubmitFromSendButton (no onSubmit).
|
||||
if (inputField != null && Application.platform != RuntimePlatform.Android)
|
||||
inputField.onSubmit.AddListener(OnSubmit);
|
||||
|
||||
foreach (var mapping in channelButtons)
|
||||
{
|
||||
@@ -200,6 +204,15 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
OnCommand_speak(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gọi từ nút Send trên UI. Trên Android đây là cách gửi duy nhất (không dùng Enter).
|
||||
/// </summary>
|
||||
public void SubmitFromSendButton()
|
||||
{
|
||||
if (inputField == null) return;
|
||||
OnSubmit(inputField.text);
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// PORT C++: CDlgChat::OnCommand_speak
|
||||
// =====================================================
|
||||
|
||||
Reference in New Issue
Block a user