Esempio n. 1
0
        private InputOption(GameObject parentGO, ModSetting modSetting) : base(parentGO, modSetting, "TextInputOption")
        {
            Button     = instantiatedGameObject.transform.Find("Button").GetComponent <Button>();
            ButtonText = instantiatedGameObject.transform.Find("Button/Text").GetComponent <Text>();
            InputField = instantiatedGameObject.transform.Find("InputField").GetComponent <InputField>();

            ButtonText.text = "Reset";
        }
Esempio n. 2
0
        private SliderOption(GameObject parentGO, ModSetting modSetting) :  base(parentGO, modSetting, "SliderOption")
        {
            MelonLoader.MelonLogger.Msg("---");
            MelonLoader.MelonLogger.Msg("SliderOption Info:");
            MelonLoader.MelonLogger.Msg(rectTransform.position.x);
            MelonLoader.MelonLogger.Msg(rectTransform.position.y);

            slider = instantiatedGameObject.transform.Find("Slider").GetComponent <Slider>();
            fill   = instantiatedGameObject.transform.Find("Slider/Fill Area/Fill").GetComponent <Image>();
            handle = instantiatedGameObject.transform.Find("Slider/Handle Slide Area/Handle").GetComponent <Image>();
        }
Esempio n. 3
0
        private InputOption(GameObject parentGO, ModSetting modSetting) : base(parentGO, modSetting, "TextInputOption")
        {
            button     = instantiatedGameObject.transform.Find("Button").GetComponent <Button>();
            buttonText = instantiatedGameObject.transform.Find("Button/Text").GetComponent <Text>();
            inputField = instantiatedGameObject.transform.Find("InputField").GetComponent <InputField>();

            inputField.SetText(modSetting.GetValue().ToString());

            buttonText.text = "Reset";
            button.AddOnClick(() => modSetting.SetValue(modSetting.GetDefaultValue()));
        }
Esempio n. 4
0
        private SliderOption(GameObject parentGO, ModSetting modSetting) :  base(parentGO, modSetting, "SliderOption")
        {
            Slider     = instantiatedGameObject.transform.Find("Slider").GetComponent <Slider>();
            Fill       = instantiatedGameObject.transform.Find("Slider/Fill Area/Fill").GetComponent <Image>();
            Handle     = instantiatedGameObject.transform.Find("Slider/Handle Slide Area/Handle").GetComponent <Image>();
            InputField = instantiatedGameObject.transform.Find("InputField").GetComponent <InputField>();

            Button     = instantiatedGameObject.transform.Find("Button").GetComponent <Button>();
            ButtonText = instantiatedGameObject.transform.Find("Button/Text").GetComponent <Text>();

            ButtonText.text = "Reset";
            Button.AddOnClick(() =>
            {
                Slider.Set(Convert.ToSingle(modSetting.GetDefaultValue()));
            });
        }
Esempio n. 5
0
 internal SharedOption(GameObject parentGO, ModSetting modSetting, string gameObjectName) : this(parentGO, gameObjectName)
 {
     this.modSetting = modSetting;
     title.text      = modSetting.GetName();
 }