- Home /
texture display
display the logo as texture for 5 sec (approx) and move on to next scene, display the time in GUI Text method
You might wanna rephrase that so that we can understand better.
i want to display a logo as GUI texture for approximately 5 sec then i have to switch to next scene where i have to display time in gui text
Answer by robert 1 · Feb 18, 2011 at 12:11 AM
var todaysDate : GameObject; //assing for 3d text var timestring; var tex : GUITexture;
function Update () { timestring = System.DateTime.Now.ToString("hh:mm:ss"); delay1(); } function delay1() { yield WaitForSeconds(5); tex.enabled = false; todaysDate.GetComponent(TextMesh).text = timestring; }
this is the answer for that question
Answer by Jason B · Feb 17, 2011 at 08:03 PM
Place your material onto a plane or cube. Adjust the mesh so that it is where you want it in relation to your camera. Light the scene with a directional light. Your script will need to consist of some sort of counter that adds to itself every frame inside of Update() (preferably multiplied by Time.deltaTime so the count is normalized on all computers), and an if statement checking what the counter is at. If it is greater than or equal to the desired amount, load the scene of your choice. Displaying the counter in your GUI Text is as simple as setting the text of it to your counter's variable + "" (which is a quick and dirty way of printing only a variable to a string.
Judging by your question, I'm going to assume you're new to programming.
I do enjoy helping people (and I do not want to sound rude or anything of the sort), but I personally don't write simple scripts for people, as I know we get a few questions occasionally where people want basic scripts written for them and rather than learn scripting, they repeatedly come back asking us to edit/rewrite them. I'd much rather help you to help yourself so we can avoid that altogether.
Everything I explained in the first paragraph can be learned about by reading the reference manual that came with Unity. I would highly recommend using/searching the scripting reference, as well as learning more about either C# or Javascript (whichever one you want to program with).
You can find the general manual here online: http://unity3d.com/support/documentation/Manual/index.html You can find code references that enable you to manipulate scenes here: http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=level You can find information about time commands, and deltaTime, here: http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=time
And you can search from that page to find any other code snippets you need to get started. I also recommend using Microsoft Visual Studio C# if you intend to use C# for programming. It's free, and has very good auto-complete to help you code "blind" and learn as you program.
Answer by Persona · Feb 17, 2011 at 11:58 PM
If the process is automated then have a GUIDraw Texture put up the GUI and have it wait for 5 seconds and trigger a boolean that sets off an application load level.