add UI and logic UI
This commit is contained in:
@@ -2996,6 +2996,12 @@ MonoBehaviour:
|
||||
horizontalRotationPerScreen: 60
|
||||
verticalRotationPerScreen: 500
|
||||
_migratedDeadZoneToNormalized: 1
|
||||
enableZoom: 1
|
||||
orbitScaleMin: 0.5
|
||||
orbitScaleMax: 2
|
||||
defaultOrbitScale: 1
|
||||
zoomSensitivityScroll: 0.15
|
||||
zoomSensitivityPinch: 0.004
|
||||
--- !u!1 &2011212591958706914
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4312,13 +4318,13 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 8741686998992894603}
|
||||
- {fileID: 3488899534283412697}
|
||||
- {fileID: 1617059115409888389}
|
||||
- {fileID: 9056141770234008732}
|
||||
- {fileID: 6541409353547558602}
|
||||
- {fileID: 2907261990866691440}
|
||||
- {fileID: 5196010413898095880}
|
||||
- {fileID: 3483809415181351540}
|
||||
- {fileID: 7451658084820611230}
|
||||
- {fileID: 1617059115409888389}
|
||||
m_Father: {fileID: 2780428059708698453}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
|
||||
@@ -134,7 +134,29 @@ TextureImporter:
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: emoji_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 5
|
||||
width: 65
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 77588f93b4af2a746b281b957418da8b
|
||||
internalID: 160063929
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
@@ -148,7 +170,8 @@ TextureImporter:
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
nameFileIdTable:
|
||||
emoji_0: 160063929
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
|
||||
+195
-17
@@ -15,13 +15,29 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
public byte channel;
|
||||
}
|
||||
|
||||
public class ChatPanelUI : MonoBehaviour
|
||||
public class ChatSystemlUI : MonoBehaviour
|
||||
{
|
||||
[Header("UI")] public ScrollRect scrollRect;
|
||||
[Header("MiniChat")]
|
||||
public Button onOpenChatPanelButton;
|
||||
[Tooltip("Parent cho các dòng tin xem trước (nên có VerticalLayoutGroup).")]
|
||||
public RectTransform miniChatContent;
|
||||
[Tooltip("Null = dùng messagePrefab.")]
|
||||
public ChatMessageView miniMessagePrefab;
|
||||
[SerializeField] int miniChatPreviewLines = 5;
|
||||
[Tooltip("Tắt raycast trên dòng preview để click xuyên xuống onOpenChatPanelButton (TMP/Image mặc định chặn Button).")]
|
||||
[SerializeField] bool miniChatPassThroughClicks = true;
|
||||
|
||||
[Header("ChatPanelUI")] public ScrollRect scrollRect;
|
||||
public GameObject chatPanelUIGO;
|
||||
public RectTransform content;
|
||||
public ChatMessageView messagePrefab;
|
||||
//public GameObject newMessageIndicator;
|
||||
public Button closeChatPanelButton;
|
||||
public Button emojiButton;
|
||||
public Button sendButton;
|
||||
|
||||
[Header("EmojiPanelUI")]
|
||||
public GameObject EmojiPanelUI;
|
||||
public Button closeEmojiPanelButton;
|
||||
|
||||
[Header("Config")] public int maxVisibleMessages = 30;
|
||||
public int maxStoredMessages = 2000;
|
||||
@@ -33,12 +49,16 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
private List<ChatMessageData> _messages = new();
|
||||
private List<ChatMessageView> _visibleViews = new();
|
||||
private List<ChatMessageData> _filteredMessagesCache = new();
|
||||
private readonly List<ChatMessageData> _miniFilterBuffer = new();
|
||||
private readonly List<ChatMessageView> _miniChatViews = new();
|
||||
|
||||
private ObjectPool<ChatMessageView> _pool;
|
||||
|
||||
private bool _userAtBottom = true;
|
||||
private ChatChannel _currentFilterChannel = ChatChannel.GP_CHAT_LOCAL;
|
||||
|
||||
ChatInputHandler _chatInput;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
ClearChat();
|
||||
@@ -65,29 +85,73 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
);
|
||||
|
||||
scrollRect.onValueChanged.AddListener(OnScrollChanged);
|
||||
|
||||
if (chatPanelUIGO != null)
|
||||
chatPanelUIGO.SetActive(false);
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
RefreshMiniChat();
|
||||
if (chatPanelUIGO == null || !chatPanelUIGO.activeSelf || _pool == null || content == null)
|
||||
return;
|
||||
|
||||
RefreshVisible();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
_chatInput = GetComponent<ChatInputHandler>();
|
||||
WireUiButtons();
|
||||
}
|
||||
|
||||
void WireUiButtons()
|
||||
{
|
||||
if (onOpenChatPanelButton != null)
|
||||
onOpenChatPanelButton.onClick.AddListener(OpenChatPanel);
|
||||
if (closeChatPanelButton != null)
|
||||
closeChatPanelButton.onClick.AddListener(CloseChatPanel);
|
||||
if (emojiButton != null)
|
||||
emojiButton.onClick.AddListener(ToggleEmojiPanel);
|
||||
if (closeEmojiPanelButton != null)
|
||||
closeEmojiPanelButton.onClick.AddListener(CloseEmojiPanel);
|
||||
if (sendButton != null)
|
||||
sendButton.onClick.AddListener(OnSendButtonClicked);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (onOpenChatPanelButton != null)
|
||||
onOpenChatPanelButton.onClick.RemoveListener(OpenChatPanel);
|
||||
if (closeChatPanelButton != null)
|
||||
closeChatPanelButton.onClick.RemoveListener(CloseChatPanel);
|
||||
if (emojiButton != null)
|
||||
emojiButton.onClick.RemoveListener(ToggleEmojiPanel);
|
||||
if (closeEmojiPanelButton != null)
|
||||
closeEmojiPanelButton.onClick.RemoveListener(CloseEmojiPanel);
|
||||
if (sendButton != null)
|
||||
sendButton.onClick.RemoveListener(OnSendButtonClicked);
|
||||
|
||||
EventBus.Unsubscribe<OnEventClearChat>(OnChatMessageClear);
|
||||
EventBus.Unsubscribe<GameSession.ChatMessageEvent>(OnChatMessageReceived);
|
||||
EventBus.Unsubscribe<ChatChannelFilterChangedEvent>(OnChannelFilterChanged);
|
||||
|
||||
|
||||
if (_pool != null)
|
||||
{
|
||||
_pool.Clear();
|
||||
_pool.Dispose();
|
||||
}
|
||||
|
||||
ClearMiniChatViews();
|
||||
}
|
||||
|
||||
private void OnChannelFilterChanged(ChatChannelFilterChangedEvent e)
|
||||
{
|
||||
if (this == null) return;
|
||||
_currentFilterChannel = e.channel;
|
||||
RefreshMiniChat();
|
||||
if (chatPanelUIGO != null && chatPanelUIGO.activeSelf)
|
||||
{
|
||||
RefreshVisible();
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShouldShowMessage(ChatMessageData data)
|
||||
@@ -145,11 +209,6 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
void OnScrollChanged(Vector2 pos)
|
||||
{
|
||||
_userAtBottom = scrollRect.verticalNormalizedPosition <= 0.001f;
|
||||
|
||||
if (_userAtBottom)
|
||||
{
|
||||
//newMessageIndicator.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsAtBottom()
|
||||
@@ -159,7 +218,7 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
|
||||
public void AddMessage(string msg, byte channel)
|
||||
{
|
||||
if (this == null || chatPanelUIGO == null) return;
|
||||
if (this == null) return;
|
||||
|
||||
var data = new ChatMessageData { message = msg, channel = channel };
|
||||
_messages.Add(data);
|
||||
@@ -167,7 +226,9 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
if (_messages.Count > maxStoredMessages)
|
||||
_messages.RemoveAt(0);
|
||||
|
||||
if (!chatPanelUIGO.activeSelf)
|
||||
RefreshMiniChat();
|
||||
|
||||
if (chatPanelUIGO == null || !chatPanelUIGO.activeSelf)
|
||||
return;
|
||||
|
||||
if (ShouldShowMessage(data))
|
||||
@@ -185,7 +246,7 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
var view = _pool.Get();
|
||||
if (view == null) view = CreateItem();
|
||||
if (view == null) return;
|
||||
|
||||
|
||||
view.transform.SetParent(content, false);
|
||||
view.transform.SetAsLastSibling();
|
||||
|
||||
@@ -211,7 +272,7 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
{
|
||||
foreach (var view in _visibleViews)
|
||||
{
|
||||
if (view != null)
|
||||
if (view != null)
|
||||
_pool.Release(view);
|
||||
}
|
||||
|
||||
@@ -233,7 +294,7 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
var view = _pool.Get();
|
||||
if (view == null) view = CreateItem();
|
||||
if (view == null) continue;
|
||||
|
||||
|
||||
view.transform.SetParent(content, false);
|
||||
view.transform.SetAsLastSibling();
|
||||
|
||||
@@ -248,11 +309,72 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
ScrollToBottom();
|
||||
}
|
||||
|
||||
void RefreshMiniChat()
|
||||
{
|
||||
if (miniChatContent == null) return;
|
||||
|
||||
_miniFilterBuffer.Clear();
|
||||
foreach (var msg in _messages)
|
||||
{
|
||||
if (ShouldShowMessage(msg))
|
||||
_miniFilterBuffer.Add(msg);
|
||||
}
|
||||
|
||||
int take = Mathf.Min(Mathf.Max(1, miniChatPreviewLines), _miniFilterBuffer.Count);
|
||||
int startIdx = _miniFilterBuffer.Count - take;
|
||||
|
||||
while (_miniChatViews.Count < take)
|
||||
{
|
||||
var v = CreateMiniChatItem();
|
||||
if (v == null) return;
|
||||
_miniChatViews.Add(v);
|
||||
}
|
||||
|
||||
while (_miniChatViews.Count > take)
|
||||
{
|
||||
var last = _miniChatViews[_miniChatViews.Count - 1];
|
||||
_miniChatViews.RemoveAt(_miniChatViews.Count - 1);
|
||||
if (last != null)
|
||||
Destroy(last.gameObject);
|
||||
}
|
||||
|
||||
for (int i = 0; i < take; i++)
|
||||
{
|
||||
var data = _miniFilterBuffer[startIdx + i];
|
||||
var view = _miniChatViews[i];
|
||||
Sprite icon = _iconCache.ContainsKey(data.channel) ? _iconCache[data.channel] : null;
|
||||
view.Bind(icon, data.message);
|
||||
view.gameObject.SetActive(true);
|
||||
view.transform.SetSiblingIndex(i);
|
||||
if (miniChatPassThroughClicks)
|
||||
DisableGraphicsRaycastUnder(view.transform);
|
||||
}
|
||||
|
||||
Canvas.ForceUpdateCanvases();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mini chat rows use TMP/Image with raycastTarget on — they sit above the open button and steal clicks.
|
||||
/// </summary>
|
||||
static void DisableGraphicsRaycastUnder(Transform root)
|
||||
{
|
||||
if (root == null) return;
|
||||
foreach (var g in root.GetComponentsInChildren<Graphic>(true))
|
||||
g.raycastTarget = false;
|
||||
}
|
||||
|
||||
ChatMessageView CreateMiniChatItem()
|
||||
{
|
||||
var prefab = miniMessagePrefab != null ? miniMessagePrefab : messagePrefab;
|
||||
if (prefab == null || miniChatContent == null) return null;
|
||||
var item = Instantiate(prefab, miniChatContent, false);
|
||||
return item;
|
||||
}
|
||||
|
||||
public void ScrollToBottom()
|
||||
{
|
||||
Canvas.ForceUpdateCanvases();
|
||||
scrollRect.verticalNormalizedPosition = 0f;
|
||||
//newMessageIndicator.SetActive(false);
|
||||
}
|
||||
|
||||
public void ClearChat()
|
||||
@@ -265,6 +387,18 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
|
||||
_visibleViews.Clear();
|
||||
_messages.Clear();
|
||||
ClearMiniChatViews();
|
||||
}
|
||||
|
||||
void ClearMiniChatViews()
|
||||
{
|
||||
foreach (var v in _miniChatViews)
|
||||
{
|
||||
if (v != null)
|
||||
Destroy(v.gameObject);
|
||||
}
|
||||
|
||||
_miniChatViews.Clear();
|
||||
}
|
||||
|
||||
public void OnHandlerChatButton()
|
||||
@@ -274,6 +408,50 @@ namespace BrewMonster.Scripts.ChatUI
|
||||
|
||||
if (open)
|
||||
RefreshVisible();
|
||||
else
|
||||
SetEmojiPanelVisible(false);
|
||||
}
|
||||
|
||||
public void OpenChatPanel()
|
||||
{
|
||||
BMLogger.Log("[Cuong] OpenChatPanel");
|
||||
if (chatPanelUIGO == null) return;
|
||||
chatPanelUIGO.SetActive(true);
|
||||
RefreshVisible();
|
||||
|
||||
_chatInput ??= GetComponent<ChatInputHandler>();
|
||||
if (_chatInput != null && _chatInput.inputField != null)
|
||||
_chatInput.inputField.ActivateInputField();
|
||||
}
|
||||
|
||||
public void CloseChatPanel()
|
||||
{
|
||||
if (chatPanelUIGO == null) return;
|
||||
chatPanelUIGO.SetActive(false);
|
||||
SetEmojiPanelVisible(false);
|
||||
}
|
||||
|
||||
public void ToggleEmojiPanel()
|
||||
{
|
||||
if (EmojiPanelUI == null) return;
|
||||
SetEmojiPanelVisible(!EmojiPanelUI.activeSelf);
|
||||
}
|
||||
|
||||
public void CloseEmojiPanel()
|
||||
{
|
||||
SetEmojiPanelVisible(false);
|
||||
}
|
||||
|
||||
void SetEmojiPanelVisible(bool visible)
|
||||
{
|
||||
if (EmojiPanelUI != null)
|
||||
EmojiPanelUI.SetActive(visible);
|
||||
}
|
||||
|
||||
void OnSendButtonClicked()
|
||||
{
|
||||
_chatInput ??= GetComponent<ChatInputHandler>();
|
||||
_chatInput?.SubmitFromSendButton();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c8b997b0a577184a8fa15710adb43ff
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,388 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4840989851120023906
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7561970608330542274}
|
||||
- component: {fileID: 3553552199954260740}
|
||||
- component: {fileID: 2098686458651577804}
|
||||
m_Layer: 5
|
||||
m_Name: Icon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7561970608330542274
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4840989851120023906}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1869019404724936087}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 94, y: 40}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!222 &3553552199954260740
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4840989851120023906}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2098686458651577804
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4840989851120023906}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 67a57872a39a6db44b5d0f897b6f4bc7, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 1
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &6240941777052618231
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5390685607869309037}
|
||||
- component: {fileID: 7228077960814023056}
|
||||
- component: {fileID: 5305392080666511277}
|
||||
- component: {fileID: 3572582094725395276}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5390685607869309037
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6240941777052618231}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1869019404724936087}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 104, y: -5}
|
||||
m_SizeDelta: {x: 521.7, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &7228077960814023056
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6240941777052618231}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5305392080666511277
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6240941777052618231}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: 'afdsaf sadf
|
||||
|
||||
safsadfsa
|
||||
|
||||
asdf
|
||||
|
||||
sadf
|
||||
|
||||
sad
|
||||
|
||||
'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
|
||||
m_sharedMaterial: {fileID: 9092487103257209053, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 30
|
||||
m_fontSizeBase: 30
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!114 &3572582094725395276
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6240941777052618231}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_VerticalFit: 2
|
||||
--- !u!1 &6627717456258223658
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1869019404724936087}
|
||||
- component: {fileID: 616079771158270572}
|
||||
- component: {fileID: 3486315639058223012}
|
||||
- component: {fileID: 1976417251556044024}
|
||||
- component: {fileID: -887576589064363463}
|
||||
- component: {fileID: 8910872808253115585}
|
||||
- component: {fileID: 6178869782871973483}
|
||||
m_Layer: 5
|
||||
m_Name: prefab_MiniChatContentsText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1869019404724936087
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6627717456258223658}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 7561970608330542274}
|
||||
- {fileID: 5390685607869309037}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: -350, y: 88.255005}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &616079771158270572
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6627717456258223658}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3486315639058223012
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6627717456258223658}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &1976417251556044024
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6627717456258223658}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 179d32c667fc2f641bdcb7afb18046b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
iconImage: {fileID: 2098686458651577804}
|
||||
messageText:
|
||||
legacy: {fileID: 0}
|
||||
tmp: {fileID: 5305392080666511277}
|
||||
--- !u!114 &-887576589064363463
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6627717456258223658}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_VerticalFit: 2
|
||||
--- !u!114 &8910872808253115585
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6627717456258223658}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 5
|
||||
m_Right: 0
|
||||
m_Top: 5
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 0
|
||||
m_Spacing: 5
|
||||
m_ChildForceExpandWidth: 0
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 1
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &6178869782871973483
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6627717456258223658}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4cf21a97aa5c9445c9859afa14de01ad, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_rectTransform: {fileID: 1869019404724936087}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af3b510e838bc934d97c31d0c665ede6
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -111,7 +111,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 99, y: -5}
|
||||
m_SizeDelta: {x: 601, y: 0}
|
||||
m_SizeDelta: {x: 581.5994, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &7228077960814023056
|
||||
CanvasRenderer:
|
||||
|
||||
@@ -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
|
||||
// =====================================================
|
||||
|
||||
@@ -15,7 +15,7 @@ MonoBehaviour:
|
||||
assetVersion: 2
|
||||
m_TextWrappingMode: 1
|
||||
m_enableKerning: 1
|
||||
m_ActiveFontFeatures: 00000000
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
m_enableTintAllSprites: 0
|
||||
m_enableParseEscapeCharacters: 1
|
||||
@@ -24,7 +24,7 @@ MonoBehaviour:
|
||||
m_missingGlyphCharacter: 0
|
||||
m_ClearDynamicDataOnBuild: 1
|
||||
m_warningsDisabled: 0
|
||||
m_defaultFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_defaultFontAsset: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
|
||||
m_defaultFontAssetPath: Fonts & Materials/
|
||||
m_defaultFontSize: 36
|
||||
m_defaultAutoSizeMinRatio: 0.5
|
||||
@@ -36,17 +36,14 @@ MonoBehaviour:
|
||||
m_fallbackFontAssets: []
|
||||
m_matchMaterialPreset: 1
|
||||
m_HideSubTextObjects: 0
|
||||
m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45,
|
||||
type: 2}
|
||||
m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45, type: 2}
|
||||
m_defaultSpriteAssetPath: Sprite Assets/
|
||||
m_enableEmojiSupport: 1
|
||||
m_MissingCharacterSpriteUnicode: 0
|
||||
m_EmojiFallbackTextAssets: []
|
||||
m_defaultColorGradientPresetsPath: Color Gradient Presets/
|
||||
m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e,
|
||||
type: 2}
|
||||
m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e, type: 2}
|
||||
m_StyleSheetsResourcePath:
|
||||
m_leadingCharacters: {fileID: 4900000, guid: d82c1b31c7e74239bff1220585707d2b, type: 3}
|
||||
m_followingCharacters: {fileID: 4900000, guid: fade42e8bc714b018fac513c043d323b,
|
||||
type: 3}
|
||||
m_followingCharacters: {fileID: 4900000, guid: fade42e8bc714b018fac513c043d323b, type: 3}
|
||||
m_UseModernHangulLineBreakingRules: 0
|
||||
|
||||
Reference in New Issue
Block a user