Sunday 8 May 2011

Update 080511

Not updated in a couple of weeks (oops) But progress has been made for sure.

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.

  1. function Update () {
  2.  if(Input.GetKey("1")){
  3.   Debug.Log("Using Camera One");
  4.   camSwap(1);
  5.  }
  6.  if(Input.GetKey("2")){
  7.   Debug.Log("Using Camera Two");
  8.   camSwap(2);
  9.  }
  10.  if(Input.GetKey("3")){
  11.   Debug.Log("Using Camera Three");
  12.   camSwap(3);
  13.  }
  14. }
  15.  
  16. function camSwap(currentCam : int){
  17.  var cameras = GameObject.FindGameObjectsWithTag("cam");
  18.  
  19.  for (var cams : GameObject in cameras){
  20.   cams.GetComponent(Camera).enabled = false;
  21.  }  
  22.  
  23.  var oneToUse : String = "Camera"+currentCam;
  24.  gameObject.Find(oneToUse).GetComponent(Camera).enabled = true;
  25. }
 Excuse the numbers, pasted this straight from the script editor.

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