From efe70f83d96c7419b1e7326d30e66b0ae69f9ac8 Mon Sep 17 00:00:00 2001 From: nexovec <30555041+nexovec@users.noreply.github.com> Date: Sun, 30 Jan 2022 13:12:09 +0100 Subject: [PATCH] fixed menu camera movement procGen --- Assets/Scenes/Vasek.unity | 2 +- Assets/Scripts/UiController.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/Scenes/Vasek.unity b/Assets/Scenes/Vasek.unity index 1f8b54d..3a94eb0 100644 --- a/Assets/Scenes/Vasek.unity +++ b/Assets/Scenes/Vasek.unity @@ -149,7 +149,7 @@ GameObject: - component: {fileID: 77683434} - component: {fileID: 77683433} m_Layer: 0 - m_Name: Main Camera + m_Name: MenuCamera m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Assets/Scripts/UiController.cs b/Assets/Scripts/UiController.cs index c49e504..bf193e2 100644 --- a/Assets/Scripts/UiController.cs +++ b/Assets/Scripts/UiController.cs @@ -22,6 +22,11 @@ public class UiController : MonoBehaviour // Start is called before the first frame update void Start() { + this.player = GameObject.Find("Body"); + ProceduralGeneration procGenScript = GameObject.Find("Level").GetComponent(); + if (procGenScript == null)Debug.LogError("REEEEeee!!"); + procGenScript.player = menuCamera; + // procGenScript.Player = playerCamera.parent; startPosition = this.player.transform.position.z; Cursor.lockState = CursorLockMode.None; Cursor.visible = true; @@ -30,6 +35,8 @@ public class UiController : MonoBehaviour } public void OnNewGameBtnClick() { + ProceduralGeneration procGenScript = GameObject.Find("Level").GetComponent(); + procGenScript.player = this.player; UiController.isInMenu = false; menuCamera.SetActive(false); playerCamera.SetActive(true);