diff --git a/Assets/Scenes/ChatroomMenu.unity b/Assets/Scenes/ChatroomMenu.unity index 24b659f..1dbc9f6 100644 --- a/Assets/Scenes/ChatroomMenu.unity +++ b/Assets/Scenes/ChatroomMenu.unity @@ -3265,8 +3265,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 16 - m_fontSizeBase: 16 + m_fontSize: 24 + m_fontSizeBase: 24 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 1 @@ -3752,6 +3752,47 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 398800032} m_CullTransparentMesh: 1 +--- !u!21 &411238451 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UI/RoundedCorners/RoundedCorners + m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _ColorMask: 15 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UseUIAlphaClip: 0 + m_Colors: + - _OuterUV: {r: 0, g: 0, b: 1, a: 1} + - _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!1 &420273259 GameObject: m_ObjectHideFlags: 0 @@ -6306,7 +6347,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image - m_Material: {fileID: 1039984665} + m_Material: {fileID: 411238451} m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} @@ -6544,6 +6585,47 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 928270038} m_CullTransparentMesh: 1 +--- !u!21 &946627556 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UI/RoundedCorners/RoundedCorners + m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _ColorMask: 15 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UseUIAlphaClip: 0 + m_Colors: + - _OuterUV: {r: 0, g: 0, b: 1, a: 1} + - _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!1 &971230925 GameObject: m_ObjectHideFlags: 0 @@ -6608,7 +6690,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image - m_Material: {fileID: 1257027051} + m_Material: {fileID: 1264819250} m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} @@ -6785,47 +6867,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1006945038} m_CullTransparentMesh: 1 ---- !u!21 &1039984665 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UI/RoundedCorners/RoundedCorners - m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _ColorMask: 15 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - - _UseUIAlphaClip: 0 - m_Colors: - - _OuterUV: {r: 0, g: 0, b: 1, a: 1} - - _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0} - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!1 &1057045262 GameObject: m_ObjectHideFlags: 0 @@ -7366,7 +7407,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image - m_Material: {fileID: 2146899973} + m_Material: {fileID: 946627556} m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} @@ -7406,7 +7447,7 @@ MonoBehaviour: m_EditorClassIdentifier: Nobi.UiRoundedCorners::Nobi.UiRoundedCorners.ImageWithRoundedCorners radius: 10 image: {fileID: 1208331055} ---- !u!21 &1257027051 +--- !u!21 &1264819250 Material: serializedVersion: 8 m_ObjectHideFlags: 0 @@ -11381,47 +11422,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2138691470} m_CullTransparentMesh: 1 ---- !u!21 &2146899973 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: UI/RoundedCorners/RoundedCorners - m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _ColorMask: 15 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - - _UseUIAlphaClip: 0 - m_Colors: - - _OuterUV: {r: 0, g: 0, b: 1, a: 1} - - _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0} - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/ChatroomMenuEntry.cs b/Assets/Scripts/ChatroomMenuEntry.cs index 387677c..518b085 100644 --- a/Assets/Scripts/ChatroomMenuEntry.cs +++ b/Assets/Scripts/ChatroomMenuEntry.cs @@ -2,7 +2,8 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler { +public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler +{ private Image bgImg; private Button optionsButton; private static ChatroomMenuEntry activeEntry; @@ -15,49 +16,69 @@ public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerEx optionsButton.gameObject.SetActive(false); } - public void OnPointerEnter(PointerEventData e) { - if (!Application.isMobilePlatform) { - if (activeEntry != null && activeEntry != this) { + public void OnPointerEnter(PointerEventData e) + { + if (!Application.isMobilePlatform) + { + if (activeEntry != null && activeEntry != this) + { activeEntry.Deactivate(); } - if (activeEntry != this) { + if (activeEntry != this) + { Activate(); } } } - public void OnPointerExit(PointerEventData e) { - if (!Application.isMobilePlatform) { - if (activeEntry != null && activeEntry != this) { + public void OnPointerExit(PointerEventData e) + { + if (!Application.isMobilePlatform) + { + if (activeEntry != null && activeEntry != this) + { activeEntry.Deactivate(); } - if (activeEntry == this) { + if (activeEntry == this) + { Deactivate(); } } } - public void OnPointerClick(PointerEventData e) { - if (Application.isMobilePlatform) { - if (activeEntry != null && activeEntry != this) { + public void OnPointerClick(PointerEventData e) + { + if (Application.isMobilePlatform) + { + if (activeEntry != null && activeEntry != this) + { activeEntry.Deactivate(); } - if (activeEntry == this) { + if (activeEntry == this) + { Deactivate(); - } else { + } + else + { Activate(); } } + else if (e.button == PointerEventData.InputButton.Right) + { + optionsButton.onClick?.Invoke(); + } } - private void Activate() { + private void Activate() + { activeEntry = this; - bgImg.color = new Color(60f/255f, 60f/255f, 60f/255f); + bgImg.color = new Color(60f / 255f, 60f / 255f, 60f / 255f); optionsButton.gameObject.SetActive(true); } - private void Deactivate() { - bgImg.color = new Color(50f/255f, 50f/255f, 50f/255f); + private void Deactivate() + { + bgImg.color = new Color(50f / 255f, 50f / 255f, 50f / 255f); optionsButton.gameObject.SetActive(false); if (activeEntry == this) activeEntry = null; }