示例#1
0
        public GameObject CreateSliderCopy()
        {
            if (OptionsMenu.Get()?.m_musicVolume == null)
            {
                return(null);
            }
            var soundSlider = OptionsMenu.Get().m_musicVolume;
            var soundSliderOrigGameObject = soundSlider.gameObject;
            var sliderCopy = Object.Instantiate(soundSliderOrigGameObject);

            if (!UiInterface.TryPopulateOrAdd("New Slider", sliderCopy, soundSliderOrigGameObject))
            {
                sliderCopy.transform.localScale = new Vector3(40.0f, 1.0f, 40.0f);
                UiInterface.UpdateOrAdd(sliderCopy.name, sliderCopy);
            }
            return(sliderCopy);
        }
示例#2
0
        public GameObject CreateButtonCopy()
        {
            if (OptionsMenu.Get()?.m_creditsButton == null)
            {
                return(null);
            }

            var buttonOrigGameObject = OptionsMenu.Get().m_creditsButton.gameObject;

            var buttonCopy = Object.Instantiate(buttonOrigGameObject);

            if (!UiInterface.TryPopulateOrAdd("New Button", buttonCopy, buttonOrigGameObject))
            {
                buttonCopy.transform.localScale = new Vector3(40.0f, 1.0f, 40.0f);
                UiInterface.UpdateOrAdd(buttonCopy.name, buttonCopy);
            }

            return(buttonCopy);
        }