Skip to content

Commit 4efd453

Browse files
committed
Modifying Username validation
1 parent 8887e30 commit 4efd453

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ Assets/Resources/PerformanceTestRunInfo**
6969
**GlobalEntitySceneDependency*
7070
**/Recordings/*
7171
UserSettings/**
72+
.vs/*

Assets/Scripts/Gameplay/UI/MainMenu/MainMenu.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ private void OnEnable()
2626
var root = GetComponent<UIDocument>().rootVisualElement;
2727
m_MainMenuPanel = root.Q<VisualElement>("main-menu-container");
2828
m_NameField = root.Q<TextField>("name-field");
29-
#if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
3029
m_NameField.value = "Player";
31-
#else
32-
m_NameField.value = Environment.UserName.ToUpper();
30+
#if (!UNITY_IPHONE || !UNITY_ANDROID)
31+
if (!string.IsNullOrEmpty(Environment.UserName))
32+
m_NameField.value = Environment.UserName.ToUpper();
3333
#endif
3434

3535
m_IpField = root.Q<TextField>("ip-field");

0 commit comments

Comments
 (0)