fixed menu camera movement procGen

This commit is contained in:
nexovec
2022-01-30 13:12:09 +01:00
parent 783946a48c
commit efe70f83d9
2 changed files with 8 additions and 1 deletions

View File

@@ -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<ProceduralGeneration>();
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<ProceduralGeneration>();
procGenScript.player = this.player;
UiController.isInMenu = false;
menuCamera.SetActive(false);
playerCamera.SetActive(true);