示例#1
0
 //TO VERIFY IF WORKS LATER
 public void BackToMainScene()
 {
     //Check which scene is run
     //If Solar System is on
     if (Application.loadedLevelName == "EarthSolarSystemScene")
     {
         if (_manageScripts.getSolarSystemStatus())
         {
             _manageScripts.CameraMovement(true);
             string     a      = Application.loadedLevelName;
             string     res    = a.Replace("Scene", "");
             GameObject newobj = GameObject.Find(res);
             Object.Destroy(newobj);
             Application.LoadLevel("MainScene");
             MyTimer mt = GameObject.Find("_EconomicMechanism").GetComponent <MyTimer>();
             mt.setChangeScene();
         }
         else
         {
             _manageScripts.CameraMovement(true);
             _manageScripts.turnOnOffPlanetaryBackground(true);
             Object.DontDestroyOnLoad(GameObject.Find("Rocket"));
             _manageScripts.turnOnOffPlanetEarth(false);
             _manageScripts.turnOnOffSolarSystem(true);
         }
     }
     //If Main Menu is on
     else if (Application.loadedLevelName == "MainMenu")
     {
         Application.LoadLevel("MainScene");
     }
 }
示例#2
0
    //Checking which planet is clicked
    private void CheckPlanet()
    {
        // Current planet name is send here from different class
        if (currentPlanetName == "Earth")
        {
            _manageScripts.turnOnOffPanel(false);
            _manageScripts.turnOnOffSolarSystem(false);
            _manageScripts.turnOnOffPlanetEarth(true);
            _manageScripts.turnOnOffPlanetaryBackground(false);
            _manageScripts.CameraMovement(false);
            Vector3 camPos = new Vector3(-11, 0, -10);
            Camera.main.transform.position = camPos;
            Camera.main.orthographicSize   = 13;
        }

        //  Current planet name is necessary to send to know which conditions have to be fulfilled
        else
        {
            _checker.CheckConditions(currentPlanetName);
        }
    }