void Start()
    {
#if UNITY_EDITOR
        txt_Warning.gameObject.SetActive(true);
#endif

        test = gameObject.GetComponent <Aliasing>();
    }
示例#2
0
        public void SettingsMenu()
        {
            string AA = Settings.AntialiasingLevels[Settings.AntialiasingLevelID] == 0 ? "Выкл" : Settings.AntialiasingLevels[Settings.AntialiasingLevelID].ToString() + "X";

            Aliasing.SetText($"Сглаживание: { AA }");
            Aliasing.SetAction(AliasingOnClick);
            Aliasing.SetPosition(new Vector2f(Settings.sWidth + 200, Settings.sHeight - 250 - 25));
            Aliasing.SetDestinationPoint(new Vector2f(Settings.sWidth - 50 - Aliasing.GetGlobalBounds().Width, Settings.sHeight - 250 - 25));
            Aliasing.StartAnimation();

            FPSLimit.SetText($"Ограничение FPS: {Settings.FPS_Limit}");
            FPSLimit.SetAction(FPSLimitOnClick);
            FPSLimit.ChangeButtonState(Settings.VSync ? ButtonState.Inactive : ButtonState.Active);
            FPSLimit.SetPosition(new Vector2f(Settings.sWidth + 200, Settings.sHeight - 200 - 25));
            FPSLimit.SetDestinationPoint(new Vector2f(Settings.sWidth - 50 - FPSLimit.GetGlobalBounds().Width, Settings.sHeight - 200 - 25));

            FPSLimit.StartAnimation();

            Resolution.SetText($"Разрешение {Settings.sWidth}X{Settings.sHeight}");
            Resolution.SetAction(ResolutionOnClick);
            Resolution.SetPosition(new Vector2f(Settings.sWidth + 200, Settings.sHeight - 150 - 25));
            Resolution.SetDestinationPoint(new Vector2f(Settings.sWidth - 50 - Resolution.GetGlobalBounds().Width, Settings.sHeight - 150 - 25));
            Resolution.StartAnimation();

            string VSynhText = Settings.VSync ? "Вкл" : "Выкл";

            VSynh.SetText($"Вертикальная синхронизация: {VSynhText}");
            VSynh.SetAction(VSynhOnClick);
            VSynh.SetPosition(new Vector2f(Settings.sWidth + 200, Settings.sHeight - 100 - 25));
            VSynh.SetDestinationPoint(new Vector2f(Settings.sWidth - 50 - VSynh.GetGlobalBounds().Width, Settings.sHeight - 100 - 25));
            VSynh.StartAnimation();

            ExitSettings.SetAction(ExitSettingsOnClick);
            ExitSettings.SetAnimationEndAction(ExitSettingsOnAnimEnd);
            ExitSettings.SetPosition(new Vector2f(Settings.sWidth + 200, Settings.sHeight - 50 - 25));
            ExitSettings.SetDestinationPoint(new Vector2f(Settings.sWidth - 50 - ExitSettings.GetGlobalBounds().Width, Settings.sHeight - 50 - 25));
            ExitSettings.StartAnimation();
        }