diff --git a/Assets/Scenes/Main Screen Scenes/host a join.unity b/Assets/Scenes/Main Screen Scenes/host a join.unity index 748b20b..6c45f0c 100644 --- a/Assets/Scenes/Main Screen Scenes/host a join.unity +++ b/Assets/Scenes/Main Screen Scenes/host a join.unity @@ -1838,6 +1838,7 @@ GameObject: - component: {fileID: 1653336031} - component: {fileID: 1653336033} - component: {fileID: 1653336032} + - component: {fileID: 1653336034} m_Layer: 5 m_Name: Text (TMP) m_TagString: Untagged @@ -1911,8 +1912,8 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 70 - m_fontSizeBase: 70 + m_fontSize: 100 + m_fontSizeBase: 100 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 @@ -1963,6 +1964,20 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1653336030} m_CullTransparentMesh: 1 +--- !u!114 &1653336034 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1653336030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d39cd22434ca71a4b820d84bd8bc7e45, type: 3} + m_Name: + m_EditorClassIdentifier: '::' + target: {fileID: 0} + prefix: 'name: ' --- !u!1 &2007534635 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PlayerNameInput.cs b/Assets/Scripts/PlayerNameInput.cs index 2888769..6aa64d0 100644 --- a/Assets/Scripts/PlayerNameInput.cs +++ b/Assets/Scripts/PlayerNameInput.cs @@ -31,7 +31,7 @@ public class PlayerNameInput : MonoBehaviour // Keep / ensure background Image var img = nameGO.GetComponent(); if (img == null) img = nameGO.AddComponent(); - img.color = new Color(0.08f, 0.10f, 0.20f, 0.92f); + img.color = Color.white; // Build viewport > (Placeholder + Text) child hierarchy required by TMP_InputField var viewportRT = MakeChild("Text Area", rt); diff --git a/Assets/Scripts/ukazmeno.cs b/Assets/Scripts/ukazmeno.cs new file mode 100644 index 0000000..5f14c12 --- /dev/null +++ b/Assets/Scripts/ukazmeno.cs @@ -0,0 +1,22 @@ +using UnityEngine; +using TMPro; + +public class ukazmeno : MonoBehaviour +{ + [SerializeField] private TMP_Text target; + [SerializeField] private string prefix = "name: "; + + void Start() + { + if (target == null) + target = GetComponent(); + + string saved = PlayerPrefs.GetString("PlayerName", ""); + + if (string.IsNullOrWhiteSpace(saved) && GameManager.Instance != null) + saved = GameManager.Instance.displayName; + + if (target != null) + target.text = string.IsNullOrWhiteSpace(saved) ? prefix : prefix + saved; + } +} \ No newline at end of file diff --git a/Assets/Scripts/ukazmeno.cs.meta b/Assets/Scripts/ukazmeno.cs.meta new file mode 100644 index 0000000..72fc790 --- /dev/null +++ b/Assets/Scripts/ukazmeno.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d39cd22434ca71a4b820d84bd8bc7e45 \ No newline at end of file