示例#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");
     }
 }
示例#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);
    }
示例#3
0
    private void InstantiateMap(int mapIndex, double reference, int basicMapIndex, MapType specialMapType)
    {
        BasicMap newMap = Instantiate(possibleMaps[mapIndex], grid.transform) as BasicMap;

        newMap.Initialize(reference, this.OnLoadNextMap, this.OnDestroyMap, this.GoToNextMap, basicMapIndex);

        switch (specialMapType)
        {
        case MapType.COMBAT_BOSS:
            CombatMap combatMap = (CombatMap)newMap;
            combatMap.SetAsBossMap();
            break;

        case MapType.TALKING_TUTORIAL:
            TalkingMap talkingMap = (TalkingMap)newMap;
            talkingMap.SetAsTutorial(basicMapIndex);
            break;
        }

        newMap.gameObject.SetActive(false);
        nextMapsToAdd.Enqueue(newMap);
    }
示例#4
0
 public void ScrollToLatLon(double lat, double lon)
 {
     Debug.Log("scrolled map");
     basicMap.Initialize(new Vector2d(lat, lon), 15);
     transform.position = new Vector3(0f, transform.position.y, 0f);
 }