Ejemplo n.º 1
0
    public void Init()
    {
        GameManager.SetState(State.Menu);

        gameObject.SetActive(true);
        ContentParent.gameObject.SetActive(true);
        ContentParent.GetComponent <RectTransform>().offsetMin = Vector2.zero;
        ContentParent.GetComponent <RectTransform>().offsetMax = Vector2.zero;

        RaceManager.Instance.InitializeSettings();
        CreateTrackSelectionButtons(directoryHelper.GetAllTracks());
        RaceOptionsUI.Init();
    }
Ejemplo n.º 2
0
    private void CreateTrackButtons()
    {
        var tracks = directoryHelper.GetAllTracks();

        mapButtonsParent.DestroyChildren();

        for (int i = 0; i < tracks.Length; i++)
        {
            var obj = Instantiate(MapButtonPrefab);
            obj.transform.SetParent(mapButtonsParent, false);
            obj.GetComponent <MapSelectionEditorButton>().SetListener(tracks[i]);

            if (i == 0)
            {
                EventSystem.current.SetSelectedGameObject(obj);
            }
        }
    }