浏览代码

Disallowing Empty Name Changes

Clearing Join Code Field on return to correctly reflect the code state.
/main/staging/small_ui_bugs
当前提交
45ad44d6
共有 7 个文件被更改,包括 164 次插入29 次删除
  1. 60
      Assets/Prefabs/UI/GameCanvas.prefab
  2. 13
      Assets/Prefabs/UI/JoinContent.prefab
  3. 98
      Assets/Prefabs/UI/RenamePopup.prefab
  4. 9
      Assets/Scripts/Game/GameManager.cs
  5. 3
      Assets/Scripts/UI/JoinCreateLobbyUI.cs
  6. 8
      Assets/Scripts/UI/JoinMenuUI.cs
  7. 2
      ProjectSettings/Packages/com.unity.services.vivox/Settings.json

60
Assets/Prefabs/UI/GameCanvas.prefab


propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: LobbyRelaySample.GameManager, LobbyRelaySample
objectReference: {fileID: 0}
- target: {fileID: 663819175912117418, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_MinWidth
value: 0
objectReference: {fileID: 0}
- target: {fileID: 663819175912117418, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_MinHeight
value: 0
objectReference: {fileID: 0}
- target: {fileID: 663819175912117418, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_FlexibleWidth
value: 0
objectReference: {fileID: 0}
- target: {fileID: 663819175912117418, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_FlexibleHeight
value: 0
objectReference: {fileID: 0}
- target: {fileID: 663819175912117418, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_LayoutPriority
value: 0
objectReference: {fileID: 0}
- target: {fileID: 663819175912117418, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_PreferredWidth
value: 0
objectReference: {fileID: 0}
- target: {fileID: 663819175912117418, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_PreferredHeight
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1119140321553661053, guid: 404728f5cffe43940b290121bd31f601, type: 3}
propertyPath: m_AnchorMax.y
value: 0

propertyPath: m_Name
value: TongueIcon
objectReference: {fileID: 0}
- target: {fileID: 1070826112545139196, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1097905206279711496, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_AnchorMax.y
value: 0

- target: {fileID: 1729213530568520925, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1733240969009089461, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1812972113098954427, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_AnchorMax.y

propertyPath: m_PreferredHeight
value: 40
objectReference: {fileID: 0}
- target: {fileID: 2905825510828002570, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2989330310034162163, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_fontSize
value: 25

propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4393070972951313089, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4515428844496569119, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4551996994186358382, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_AnchorMax.y
value: 0

- target: {fileID: 4927412524127554603, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_PreferredHeight
value: 40
objectReference: {fileID: 0}
- target: {fileID: 5019529806587931366, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5263639458761575591, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_AnchorMax.y

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6455527238533904754, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6520888008628790540, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0

- target: {fileID: 8077960435604160994, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8160491488537189612, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8314514420049872699, guid: 247f79ab5aefc6d40bcbdade4d9467b7, type: 3}
propertyPath: m_Color.b

13
Assets/Prefabs/UI/JoinContent.prefab


m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1462126939442648229}
m_TargetAssemblyTypeName: LobbyRelaySample.UI.JoinMenuUI, LobbyRelaySample
m_MethodName: JoinMenuChangedVisibility
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_JoinCodeField: {fileID: 8659642538454988273}
--- !u!114 &7550446569341709048
MonoBehaviour:
m_ObjectHideFlags: 0

98
Assets/Prefabs/UI/RenamePopup.prefab


m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &557953118367534400
RectTransform:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Rename
m_text: Close
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 5302535af1044152a457ed104f1f4b91, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: b246c4190f4e46ec9352fe15a7b09ce0, type: 2}

m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinWidth: 400
m_PreferredWidth: 800
m_PreferredWidth: 1200
m_FlexibleWidth: -1
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &6042065811192405319

m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinWidth: 400
m_PreferredWidth: 800
m_PreferredWidth: 700
m_PreferredHeight: 50
m_FlexibleWidth: -1
m_FlexibleHeight: -1

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 15
--- !u!1 &8714174394522057228
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3465787506840996812}
- component: {fileID: 8314980018121597183}
- component: {fileID: 7056713423232892002}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3465787506840996812
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8714174394522057228}
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_Children: []
m_Father: {fileID: 4299827590990313863}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -10, y: -4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8314980018121597183
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8714174394522057228}
m_CullTransparentMesh: 1
--- !u!114 &7056713423232892002
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8714174394522057228}
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: 0, g: 0, b: 0, a: 0.5019608}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 4354914e98ed5184596c36700cb95cd6, type: 3}
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!1 &9073342297542081171
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 8711958881930819624}
- component: {fileID: 6511168087757074800}
m_Layer: 5
m_Name: RenameButton
m_Name: BackButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_Children:
- {fileID: 557953118367534400}
- {fileID: 3886665443646860209}
- {fileID: 3465787506840996812}
m_Father: {fileID: 1113109783147550039}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9490197, g: 0.6862745, b: 0.5176471, a: 1}
m_Color: {r: 0.9622642, g: 0.27687788, b: 0.6599941, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: 100
m_MinWidth: 50
m_PreferredWidth: 100
m_PreferredWidth: 50
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1

9
Assets/Scripts/Game/GameManager.cs


public void OnReceiveMessage(MessageType type, object msg)
{
if (type == MessageType.RenameRequest)
{ m_localUser.DisplayName = (string)msg;
{
string name = (string)msg;
if (string.IsNullOrEmpty(name) || string.IsNullOrWhiteSpace(name))
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.DisplayErrorPopup, "Empty Name not allowed."); // Lobby error type, then HTTP error type.
return;
}
m_localUser.DisplayName = (string)msg;
}
else if (type == MessageType.CreateLobbyRequest)
{

3
Assets/Scripts/UI/JoinCreateLobbyUI.cs


Hide();
}
}
}
}

8
Assets/Scripts/UI/JoinMenuUI.cs


[SerializeField]
RectTransform m_LobbyButtonParent;
[SerializeField]
TMP_InputField m_JoinCodeField;
/// <summary>
/// Key: Lobby ID, Value Lobby UI
/// </summary>

public void JoinMenuChangedVisibility(bool show)
{
if (show)
{
m_JoinCodeField.text = "";
}
public void OnQuickJoin()
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.QuickJoin, null);

2
ProjectSettings/Packages/com.unity.services.vivox/Settings.json


{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "isEnvironmentCustom",
"value": "{\"m_Value\":false}"
"value": "{\"m_Value\":true}"
},
{
"type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",

正在加载...
取消
保存