Exemplo n.º 1
0
        protected override void DidActivate(bool firstActivation, ActivationType type)
        {
            if (firstActivation)
            {
                if (includeBackButton && _backButton == null)
                {
                    _backButton = BeatSaberUI.CreateBackButton(rectTransform as RectTransform);
                    _backButton.onClick.AddListener(delegate()
                    {
                        backButtonPressed?.Invoke();
                    });
                }
            }

            DidActivateEvent?.Invoke(firstActivation, type);
        }
        public static Button CreateBackButton(this VRUIViewController parent)
        {
            Button btn = BeatSaberUI.CreateBackButton(parent.rectTransform);

            return(btn);
        }
        public static Button CreateUIButton(this VRUIViewController parent, string buttonTemplate, UnityAction onClick = null, string buttonText = "BUTTON", Sprite icon = null)
        {
            Button btn = BeatSaberUI.CreateUIButton(parent.rectTransform, buttonTemplate, onClick, buttonText, icon);

            return(btn);
        }
        public static Button CreateUIButton(this VRUIViewController parent, string buttonTemplate)
        {
            Button btn = BeatSaberUI.CreateUIButton(parent.rectTransform, buttonTemplate);

            return(btn);
        }
        public static ColorPicker CreateColorPicker(this VRUIViewController parent, Vector2 anchoredPosition, Vector2 sizeDelta)
        {
            ColorPicker colorPicker = BeatSaberUI.CreateColorPicker(parent.rectTransform, anchoredPosition, sizeDelta);

            return(colorPicker);
        }
        public static CustomSlider CreateUISlider(this VRUIViewController parent, float min, float max, float increment, bool intValues, UnityAction <float> onValueChanged = null)
        {
            CustomSlider scrollbar = BeatSaberUI.CreateUISlider(parent.rectTransform, min, max, increment, intValues, onValueChanged);

            return(scrollbar);
        }
        public static TextMeshProUGUI CreateText(this VRUIViewController parent, string text, Vector2 anchoredPosition)
        {
            TextMeshProUGUI textMesh = BeatSaberUI.CreateText(parent.rectTransform, text, anchoredPosition);

            return(textMesh);
        }
        public static GameObject CreateLoadingSpinner(this VRUIViewController parent)
        {
            GameObject loadingSpinner = BeatSaberUI.CreateLoadingSpinner(parent.rectTransform);

            return(loadingSpinner);
        }
 public static HMUI.Scrollbar CreateUISlider(this VRUIViewController parent, float fromValue, float toValue, bool intValues, UnityAction <float> onValueChanged = null)
 {
     HMUI.Scrollbar scrollbar = BeatSaberUI.CreateUISlider(parent.rectTransform, fromValue, toValue, intValues, onValueChanged);
     return(scrollbar);
 }