Ejemplo n.º 1
0
    public void generatePlanet()
    {
        if (((sm.listeVisited[this.planetIndex - 1] == true && sm.listeVisited[this.planetIndex] == false) || (this.planetIndex == 1 && sm.listeVisited[this.planetIndex] == false)) && this.planetIndex != 9)
        {
            //Si la planète n'a pas déjà été générée on la génère
            if (this.myPlanet == null)
            {
                this.myPlanet = new MyPlanet();
                this.changePlanetSkin(myPlanet.getPlanetType().getType());
                this.getPlanetInfo();
                this.infoTravel.text = "You are here\nClick on the planet to land";
            }
            else
            {
                //================================================================
                // Put here code to land on the planet
                GameObject.Find("SceneManager").GetComponent <CustomSceneManager>().TravelTo(this);
                //================================================================

                Debug.Log("land");

                // La planète a été visité
                sm.listeVisited[this.planetIndex] = true;
            }
        }
        else if (sm.listeVisited[this.planetIndex - 1] == true && this.planetIndex == 9)
        {
            //================================================================
            // Put win or losing condition here when palyer arrive to homeland
            GameObject.Find("SceneManager").GetComponent <CustomSceneManager>().WinTheGame();
            //================================================================
            Debug.Log("game win");
        }
    }