- Home /
How do I switch screen view to another view/window?
I am working on game where the player can use a computer, so when the player click "use computer" I want to display computer screen(not real computer but my own design) with buttons and then when the user click logout, the computer screen view will exist and the original player view is back.
What i was thinking is making the computer screen in a another separate scene, however this will be inconvenient for the user to wait for another scene to load just to use the computer, i just want the computer view displayed as soon as the user click "use computer", so i guess that means I should do it in the same scene.
I am not that experienced with Unity, so any ideas or suggestions will be appreciated, like if I should use UI, or GUI..etc.
Thank you
Answer by JacobFlynnPrendi · Jul 17, 2017 at 04:10 AM
For this instance, you will probably be better off having a Second Camera Parented to the Computer Prefab positioned how you would like. Then you can program your MainCamera to switch to this camera when using the computer.
Camera main;
Camera computer;
void SwitchCameras()
{
main.enabled = !main.enabled;
computer.enabled = !computer.enable;
}
Obviously how you interact with this is up to you but hopefully it gives you an option to play with.
thanks , i was thinking the same thing , with a canvas, but i thought there is another way.