public void Start()
    {
        if (PlanetModifiers.Planets.Count == 0)
        {
            PlanetModifiers.init();
        }


        playGameBtn = transform.Find("Play_Button").GetComponent <Button>();
        playGameBtn.onClick.AddListener(PlayGame);


        backBtn = transform.Find("Back_Button").GetComponent <Button>();
        backBtn.onClick.AddListener(Back);

        creatureName = transform.Find("Input_Name").GetComponent <InputField>();

        messageBox = transform.Find("Message_Box").GetComponent <MessageOk>();
    }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        //set planet to earthlike if null
        if (PlanetInfo.info.landColors == null)
        {
            PlanetModifiers.init();
            var first = PlanetModifiers.Planets.First();
            PlanetInfo.setInfo(PlanetModifiers.Planets[first.Key]);
        }

        waterIndex    = Random.Range(0, PlanetInfo.info.waterColors.Count);
        landIndex     = Random.Range(0, PlanetInfo.info.landColors.Count);
        mountainIndex = Random.Range(0, PlanetInfo.info.mountainColors.Count);

        if (WorldProperties.planetTexture == null)
        {
            WorldProperties.planetTexture = GenerateTexture();
        }
    }
    public void Start()
    {
        if (PlanetModifiers.Planets.Count == 0)
        {
            PlanetModifiers.init();
        }

        planetDropDown = transform.Find("Planet_Dropdown").GetComponent <Dropdown>();
        populateDropdown();
        planetDropDown.onValueChanged.AddListener(delegate {
            changePlanetType(planetDropDown);
        });


        playGameBtn  = transform.Find("Next_Button").GetComponent <Button>();
        genPlanetBtn = transform.Find("Refresh_Button").GetComponent <Button>();
        playGameBtn.onClick.AddListener(PlayGame);
        genPlanetBtn.onClick.AddListener(GeneratePlanet);

        backBtn = transform.Find("Back_Button").GetComponent <Button>();
        backBtn.onClick.AddListener(Back);

        planetName = transform.Find("Input_Name").GetComponent <InputField>();

        scaleSlider       = transform.Find("Scale_Slider").GetComponent <Slider>();
        scaleSlider.value = PlanetInfo.info.planetScale;
        scaleSlider.onValueChanged.AddListener(delegate { valueChangeScale(); });

        speedSlider       = transform.Find("Speed_Slider").GetComponent <Slider>();
        speedSlider.value = PlanetInfo.info.rotationSpeed;
        speedSlider.onValueChanged.AddListener(delegate { valueChangeSpeed(); });

        messageBox = transform.Find("Message_Box").GetComponent <MessageOk>();
        pt         = transform.Find("Planet_Preview").GetComponentInChildren <PerlinNoiseTerrain>();
        pb         = transform.Find("Planet_Preview").GetComponentInChildren <PlanetBehaviour>();
    }