Initial Login Screen Help

Hi,

I’m completely new to Unity - still working through tutorials etc. I’m starting to work through things in my head though and just wanted to check whether or not I’m on the right track.

I’m creating an app which will initially launch an “empty room”. It will also immediately show a form over that which requires the user to login (using a web service). If they are successful in logging in, the form will clear and certain objects will drop into the room depending on who the user is.

What I’m not sure about is where this code “sits”. All my little experiments have been attached to the main camera so far, but I’m not sure if that’s correct in the long run.

This is my basic understanding of how the logic for what I’m trying to do might look. Is this on the right track?

public var requiresLogin = true;

function Update () {
   if(requiresLogin) {
	Do nothing because the login screen is up
   }
   else {
	The login form should have disappeared (?????)
	Start dropping objects into the scene      
   }
}


function OnGUI() {
   if(requiresLogin) {
	Build and display the login form

	If complete and login is successful then
	requiresLogin = false;
   }
}

Yes, you are on the right track.

As for where it ‘sits’ that’s entirely up to you. There is no particular convention which everyone must follow. Attaching the script to your camera is just as valid as creating a game object with no renderer for the same purpose.

Thank you. To be honest, I think I jumped the gun a little even asking this question. I’m putting my head down and getting stuck into some tutorials before I even start thinking about this stuff again. Nice to know I wasn’t completely off track though! :slight_smile:

Very excited about Unity - it’s such a fantastic tool to work with.