Exemplo n.º 1
0
 // public void LoadCity (int)
 // for now it takes in a variable that was assigned to a button in the inspector. this is to
 // tell it which city to start in.
 public void LoadCity(int temp)
 {
     if (temp == 1) // San Diego
     {
         coords2d = new Vector2d(32.7157, -117.1611);
         basicMap.Initialize(coords2d, 15);
         prefabHeight = getHeight.HeightForPrefab(coords2d.x, coords2d.y, basicMap);
         StartCoroutine("CameraSwitch");
     }
     else if (temp == 2) // Laramie
     {
         coords2d = new Vector2d(41.3114, -105.5911);
         basicMap.Initialize(coords2d, 15);
         prefabHeight = getHeight.HeightForPrefab(coords2d.x, coords2d.y, basicMap);
         StartCoroutine("CameraSwitch");
     }
     else if (temp == 3) // Denver
     {
         coords2d = new Vector2d(39.742043, -104.991531);
         basicMap.Initialize(coords2d, 15);
         prefabHeight = getHeight.HeightForPrefab(coords2d.x, coords2d.y, basicMap);
         StartCoroutine("CameraSwitch");
     }
     else if (temp == 4) // Los Angeles
     {
         coords2d = new Vector2d(34.052235, -118.243683);
         basicMap.Initialize(coords2d, 15);
         prefabHeight = getHeight.HeightForPrefab(coords2d.x, coords2d.y, basicMap);
         StartCoroutine("CameraSwitch");
     }
 }
Exemplo n.º 2
0
    // IEnumerator Camera Switch ()
    // Delays the camera from displaying the game level until everything should have loaded
    IEnumerator CameraSwitch()
    {
        header.text = "Please wait...";
        yield return(new WaitForSeconds(2));

        Vector2d myLoc;

        myLoc = geoForward.GetLoc();
        basicMap.Initialize(myLoc, 15);
        yield return(new WaitForSeconds(3));

        prefabHeight = getHeight.HeightForPrefab(myLoc.x, myLoc.y, basicMap);
        aiSpawner.BeginPlacing(prefabHeight);
        yield return(new WaitForSeconds(2));

        myMain.transform.position = new Vector3(myMain.transform.position.x, myMain.transform.position.y + (float)prefabHeight,
                                                myMain.transform.position.z);
        myMain.SetActive(true);
        splashCanvas.SetActive(false);
        gameObject.SetActive(false);
    }