From 5dd18e2a43692ef43eb4febdfab1a09e22a5b886 Mon Sep 17 00:00:00 2001 From: Stefan Richter <o-s-r1993@web.de> Date: Mon, 4 Dec 2023 06:34:35 +0100 Subject: [PATCH] Resolved some "null" error messages from AlignText, and changed name of TalkingButton to Interact. --- Assets/Resources/Prefabs/Task-Character.prefab | 4 ++-- .../Prefabs/UI/Ingame/FrameITUI_mobile.prefab | 4 +--- Assets/Scripts/InteractionEngine/AlignText.cs | 11 +++++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Assets/Resources/Prefabs/Task-Character.prefab b/Assets/Resources/Prefabs/Task-Character.prefab index 60cd13fa..be3f21d3 100644 --- a/Assets/Resources/Prefabs/Task-Character.prefab +++ b/Assets/Resources/Prefabs/Task-Character.prefab @@ -637,8 +637,8 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6999573640440716754} m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 + m_IsTrigger: 1 + m_Enabled: 1 serializedVersion: 2 m_Size: {x: 3, y: 1.7, z: 0.1} m_Center: {x: 0, y: 0.1, z: 0} diff --git a/Assets/Resources/Prefabs/UI/Ingame/FrameITUI_mobile.prefab b/Assets/Resources/Prefabs/UI/Ingame/FrameITUI_mobile.prefab index 7d7b9664..31d6d0d0 100644 --- a/Assets/Resources/Prefabs/UI/Ingame/FrameITUI_mobile.prefab +++ b/Assets/Resources/Prefabs/UI/Ingame/FrameITUI_mobile.prefab @@ -232,9 +232,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: 'Reden - -' + m_Text: Interact --- !u!1 &464427703213787929 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/InteractionEngine/AlignText.cs b/Assets/Scripts/InteractionEngine/AlignText.cs index dabac3fa..7fb526d0 100644 --- a/Assets/Scripts/InteractionEngine/AlignText.cs +++ b/Assets/Scripts/InteractionEngine/AlignText.cs @@ -13,10 +13,12 @@ public class AlignText : MonoBehaviour public Camera BackUPCam; // public GameObject Moving_GObj; + void Start() { StartCoroutine(CheckForNewMainCamRoutine()); + } // Update is called once per frame @@ -32,8 +34,13 @@ void Update() //Problem is the relative rotation of the TextMesh to the Line-Parent //transform.rotation = Quaternion.Lerp(transform.parent.transform.rotation, Cam.transform.rotation, 0); //if (Moving_GObj) { } - if (UIconfig.controlMode == ControlMode.Keyboard) { gameObject.GetComponent<BoxCollider>().enabled = false; } - if (UIconfig.controlMode == ControlMode.Mobile) { gameObject.GetComponent<BoxCollider>().enabled = true; } + + //Überprüfen ob Textfeld einen Collider hat, und wenn ja dieser aktiv sein soll + if (gameObject.GetComponent<BoxCollider>() != null) + { + if (UIconfig.controlMode == ControlMode.Keyboard) { gameObject.GetComponent<BoxCollider>().enabled = false; } + if (UIconfig.controlMode == ControlMode.Mobile) { gameObject.GetComponent<BoxCollider>().enabled = true; } + } } Camera toCamMain() -- GitLab