My current goal (today) is to create a 'splash page' a page which is launched before the playable part, basically a menu screen. With the logo, a couple of GUI buttons and a background of some sort.
My task today is to create alternating cameras for my background, that are set up in key area to provide a more interesting menu screen instead of a static image. I have come up against a couple of problems, one being that I can't get the cameras for function right on a timer, essentially alternating and looping through different cameras automaticly, the problem I have is that it skips camera 1 (of 3 at the moment) sticks on 2 for around 20 seconds and then jumps to 3 for the remainder of the time and doesn't loop. I'll look into that in more depth later on but for the minute I have the function running and looping with a ".GetKey" function running for 1, 2, and 3 numeric keys.
Heres is the pain in the arse code with the .GetKey funtion.
- function Update () {
- if(Input.GetKey("1")){
- Debug.Log("Using Camera One");
- camSwap(1);
- }
- if(Input.GetKey("2")){
- Debug.Log("Using Camera Two");
- camSwap(2);
- }
- if(Input.GetKey("3")){
- Debug.Log("Using Camera Three");
- camSwap(3);
- }
- }
-
- function camSwap(currentCam : int){
- var cameras = GameObject.FindGameObjectsWithTag("cam");
-
- for (var cams : GameObject in cameras){
- cams.GetComponent(Camera).enabled = false;
- }
-
- var oneToUse : String = "Camera"+currentCam;
- gameObject.Find(oneToUse).GetComponent(Camera).enabled = true;
- }
So hopefully by the end of today I will have a functioning splash page Complete with Logo and 2 GUI buttons (PLAY and ABOUT OVERLAND)
Aside from that I am plugging along with texturing and adding small features to flesh the world out. though the texturing is taking up a lot of time.
No comments:
Post a Comment