예제 #1
0
    private void Awake()
    {
        var res = Settings.ResolutionToVector(Settings.resolutionCurrent);

        if (Settings.StringToScreenMode(Settings.screenmodeCurrent) != Screen.fullScreenMode)
        {
            Settings.SetResolution(res, Settings.StringToScreenMode(Settings.screenmodeCurrent));
        }
        var container = transform.Find("MainMenuContainer");
        var intro     = transform.Find("Intro");

        highScores    = container.Find("HighScores").gameObject;
        loading       = highScores.transform.Find("Loading").gameObject;
        content       = highScores.transform.Find("Table").Find("Content").gameObject;
        helpBarImages = container.Find("HelpBar").GetComponentsInChildren <Image>();
        helpBarTexts  = container.Find("HelpBar").GetComponentsInChildren <TextMeshProUGUI>();
        pointers      = container.Find("Pointers");
        highScores.SetActive(false);
        JoystickHandler.DetectControllerType();
        GetHelpBarButtonImages();
        leftRightMenu = Instantiate(leftRight);
        leftRightMenu.transform.SetParent(transform);
        leftRightMenu.SetActive(false);
        sliderMenu = Instantiate(slider);
        sliderMenu.transform.SetParent(transform);
        sliderMenu.SetActive(false);
        leftRightText = leftRightMenu.GetComponentInChildren <TextMeshProUGUI>();
        intro.gameObject.SetActive(true);
    }
예제 #2
0
 private void Start()
 {
     Health     = maxHealth / 2;
     info       = animator.GetCurrentAnimatorClipInfo(1);
     cam        = Camera.main;
     controller = JoystickHandler.DetectControllerType();
     InputSystem.onDeviceChange += (a, b) => controller = JoystickHandler.DetectControllerType();
 }