Fix chatroom for mobile
This commit is contained in:
@@ -2,10 +2,11 @@ using UnityEngine;
|
|||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler {
|
public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler {
|
||||||
private Image bgImg;
|
private Image bgImg;
|
||||||
private Button optionsButton;
|
private Button optionsButton;
|
||||||
private bool isMadeBySelf = false;
|
private bool isMadeBySelf = false;
|
||||||
|
private static ChatroomMenuEntry activeEntry;
|
||||||
|
|
||||||
public void Init(Image bgImgArg, Button optionsButtonArg, bool isMadeBySelfArg)
|
public void Init(Image bgImgArg, Button optionsButtonArg, bool isMadeBySelfArg)
|
||||||
{
|
{
|
||||||
@@ -17,12 +18,39 @@ public class ChatroomMenuEntry : MonoBehaviour, IPointerEnterHandler, IPointerEx
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void OnPointerEnter(PointerEventData e) {
|
public void OnPointerEnter(PointerEventData e) {
|
||||||
bgImg.color = new Color(60f/255f, 60f/255f, 60f/255f);
|
if (e.pointerId < 0 && activeEntry != this) {
|
||||||
optionsButton.gameObject.SetActive(isMadeBySelf);
|
bgImg.color = new Color(60f/255f, 60f/255f, 60f/255f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPointerExit(PointerEventData e) {
|
public void OnPointerExit(PointerEventData e) {
|
||||||
|
if (e.pointerId < 0 && activeEntry != this) {
|
||||||
|
bgImg.color = new Color(50f/255f, 50f/255f, 50f/255f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPointerClick(PointerEventData e) {
|
||||||
|
if (e.pointerId >= 0 && isMadeBySelf) {
|
||||||
|
if (activeEntry != null && activeEntry != this) {
|
||||||
|
activeEntry.Deactivate();
|
||||||
|
}
|
||||||
|
if (activeEntry == this) {
|
||||||
|
Deactivate();
|
||||||
|
} else {
|
||||||
|
Activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Activate() {
|
||||||
|
activeEntry = this;
|
||||||
|
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);
|
bgImg.color = new Color(50f/255f, 50f/255f, 50f/255f);
|
||||||
optionsButton.gameObject.SetActive(false);
|
optionsButton.gameObject.SetActive(false);
|
||||||
|
if (activeEntry == this) activeEntry = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,6 +131,9 @@ MonoBehaviour:
|
|||||||
m_PrefilterNativeRenderPass: 1
|
m_PrefilterNativeRenderPass: 1
|
||||||
m_PrefilterUseLegacyLightmaps: 0
|
m_PrefilterUseLegacyLightmaps: 0
|
||||||
m_PrefilterBicubicLightmapSampling: 1
|
m_PrefilterBicubicLightmapSampling: 1
|
||||||
|
m_PrefilterReflectionProbeBlending: 1
|
||||||
|
m_PrefilterReflectionProbeBoxProjection: 1
|
||||||
|
m_PrefilterReflectionProbeAtlas: 1
|
||||||
m_ShaderVariantLogLevel: 0
|
m_ShaderVariantLogLevel: 0
|
||||||
m_ShadowCascades: 0
|
m_ShadowCascades: 0
|
||||||
m_Textures:
|
m_Textures:
|
||||||
|
|||||||
@@ -63,7 +63,19 @@ MonoBehaviour:
|
|||||||
- rid: 3112322278297174019
|
- rid: 3112322278297174019
|
||||||
- rid: 8086992105169485824
|
- rid: 8086992105169485824
|
||||||
m_RuntimeSettings:
|
m_RuntimeSettings:
|
||||||
m_List: []
|
m_List:
|
||||||
|
- rid: 7752762179098771456
|
||||||
|
- rid: 7752762179098771457
|
||||||
|
- rid: 7752762179098771459
|
||||||
|
- rid: 7752762179098771461
|
||||||
|
- rid: 7752762179098771462
|
||||||
|
- rid: 7752762179098771464
|
||||||
|
- rid: 7752762179098771466
|
||||||
|
- rid: 7752762179098771468
|
||||||
|
- rid: 7752762179098771472
|
||||||
|
- rid: 7752762179098771476
|
||||||
|
- rid: 3114554777721110529
|
||||||
|
- rid: 3114554777721110530
|
||||||
m_AssetVersion: 8
|
m_AssetVersion: 8
|
||||||
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
||||||
m_RenderingLayerNames:
|
m_RenderingLayerNames:
|
||||||
|
|||||||
Reference in New Issue
Block a user