Hey everyone,
I am developing an application that is using string for Augmented Reality. A brief background is that a student will be able to take an Ipad and reconstruct a wall with different materials such as if they wanted to change the pre-existing glass of the wall to be brick or copper or even stone they would be able to do so and then view that model that they have been working on in Augmented Reality. I am trying to do this by using 2 different cameras. The one camera is of course the main camera that holds the script for the drawing interface with the model that they are working on. The second camera will of course hold the script for String.
I have tried researching multiple posts about switching Cameras and have not been able to find one that works. My issue is that on load the camera of choice is always String, where as it should be the mainCamera until the user selects the View Model Button.
Does anyone have any idea of what I am doing wrong? Below is code as to what I have written that does not seem to work:
Thank you very much :o
function Start()
{
mainCamera.enabled = true;
mainCameraEnabled = true;
stringCameraEnabled = false;
stringCamera.enabled = false;
}
function Update()
{
if(mainCameraEnabled == true)
{
mainCamera.enabled = true;
stringCamera.enabled = false;
}
if(stringCameraEnabled == true)
{
stringCamera.enabled = true;
mainCamera.enabled = false;
}
}
function OnGUI()
{
if(GUILayout.Button("View Model", GUILayout.Height(backButtonSpacing)))
{
stringCameraEnabled = true;
if(stringCameraEnabled == true)
{
stringCamera.enabled = true;
mainCamera.enabled = false;
}
}
}