Example #1
0
        public override void SetData(CheatMenuOptions cheatMenuOptions, CheatMenuData unitTestingData)
        {
            m_cheatMenuOptions = cheatMenuOptions;
            m_unitTestingData  = unitTestingData;

            gameObject.transform.Find("TitleText").GetComponent <Text>().text = m_unitTestingData.MethodName.ToScriptName();

            Button button = GetComponent <Button>();

            button.onClick.RemoveAllListeners();
            button.onClick.AddListener(OnButtonClicked);
        }
Example #2
0
        public override void SetData(CheatMenuOptions cheatMenuOptions, CheatMenuData unitTestingData)
        {
            m_cheatMenuOptions = cheatMenuOptions;
            m_unitTestingData  = unitTestingData;

            gameObject.transform.Find("TitleText").GetComponent <Text>().text = m_unitTestingData.MethodName.ToScriptName();

            GetComponentInChildren <UnityEngine.UI.InputField>().onValueChanged.RemoveAllListeners();
            GetComponentInChildren <UnityEngine.UI.InputField>().onValueChanged.AddListener(this.OnValueChanged);

            GetComponentInChildren <UnityEngine.UI.Button>().onClick.RemoveAllListeners();
            GetComponentInChildren <UnityEngine.UI.Button>().onClick.AddListener(this.OnApplyButtonClick);
        }
Example #3
0
        public override void SetData(CheatMenuOptions cheatMenuOptions, CheatMenuData unitTestingData)
        {
            m_cheatMenuOptions = cheatMenuOptions;
            m_unitTestingData  = unitTestingData;

            gameObject.transform.Find("TitleText").GetComponent <Text>().text = m_unitTestingData.MethodName.ToScriptName();

            CheatToggle attribute = m_unitTestingData.Attribute as CheatToggle;

            Toggle toggle = GetComponent <Toggle>();

            toggle.onValueChanged.RemoveAllListeners();
            toggle.onValueChanged.AddListener(OnToggleChanged);
            toggle.isOn = attribute.IsOn;
        }
Example #4
0
        public override void SetData(CheatMenuOptions cheatMenuOptions, CheatMenuData unitTestingData)
        {
            m_cheatMenuOptions = cheatMenuOptions;
            m_unitTestingData  = unitTestingData;

            gameObject.transform.Find("TitleText").GetComponent <Text>().text = m_unitTestingData.MethodName.ToScriptName();
            m_valueText = gameObject.transform.Find("ValueText").GetComponent <Text>();

            CheatSlider attribute = m_unitTestingData.Attribute as CheatSlider;

            UnityEngine.UI.Slider slider = GetComponentInChildren <UnityEngine.UI.Slider>();
            slider.onValueChanged.RemoveAllListeners();
            slider.onValueChanged.AddListener(OnValueChanged);
            slider.minValue  = attribute.MinValue;
            slider.maxValue  = attribute.MaxValue;
            slider.value     = attribute.InitValue;
            m_valueText.text = attribute.InitValue.ToString();
        }
Example #5
0
        public override void SetData(CheatMenuOptions cheatMenuOptions, CheatMenuData unitTestingData)
        {
            m_cheatMenuOptions = cheatMenuOptions;
            m_unitTestingData  = unitTestingData;

            gameObject.transform.Find("TitleText").GetComponent <Text>().text = m_unitTestingData.MethodName.ToScriptName();

            CheatDropdown attribute = m_unitTestingData.Attribute as CheatDropdown;

            m_optionData = attribute.OptionData;

            Dropdown dropdown = GetComponentInChildren <Dropdown>();

            dropdown.onValueChanged.RemoveAllListeners();
            dropdown.onValueChanged.AddListener(OnValueChange);
            dropdown.ClearOptions();
            dropdown.AddOptions(m_optionData);

            OnValueChange(0);
        }
Example #6
0
        private void Awake()
        {
            m_spaceWidth = m_templateParent.GetComponent <GridLayoutGroup>().spacing.x;

            m_cheatMenuOptions = new CheatMenuOptions();
            m_cheatMenuPages   = new List <CheatMenuPage>();
            string[] categories = m_cheatMenuOptions.GetAllCategories();
            for (int i = 0; i < categories.Length; i++)
            {
                CheatMenuPage unitTestingPage = Instantiate(m_templateCheatMenuPage);
                unitTestingPage.transform.SetParent(m_cheatMenuPageParent, false);
                unitTestingPage.Title = categories[i];
                unitTestingPage.gameObject.SetActive(true);
                m_cheatMenuPages.Add(unitTestingPage);
            }

            m_cheatMenuCategory.SetData(m_cheatMenuPages);

            StartCoroutine(GeneratePages());
        }
Example #7
0
 public abstract void SetData(CheatMenuOptions cheatMenuOptions, CheatMenuData unitTestingData);