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);