public override void SetOptionData(DebuggerOptionData optData) { base.SetOptionData(optData); if (optData.IsProperty) { bool isNumeric = optData.memberInfo.IsPropertyNumber(); bool isDecimal = optData.memberInfo.IsPropertyDecimal(); if (isDecimal) { propertyInputField.contentType = InputField.ContentType.DecimalNumber; } else if (isNumeric) { propertyInputField.contentType = InputField.ContentType.IntegerNumber; } else { propertyInputField.contentType = InputField.ContentType.Standard; } RefreshTextValue(); buttonDecrement.gameObject.SetActive(isNumeric || isDecimal); buttonIncrement.gameObject.SetActive(isNumeric || isDecimal); } }
private void PopulateOptions() { debuggerOptionList = new Dictionary <string, List <DebuggerOptionData> > (); Type optionType = typeof(DebuggerOptions); MemberInfo[] memberInfo = optionType.GetMembers( BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.DeclaredOnly) .Where(x => IsMemberInfoValid(x)) .ToArray(); int fieldInfoLength = memberInfo.Length; for (int i = 0; i < fieldInfoLength; i++) { DebuggerOptionData option = new DebuggerOptionData(); DisplayNameAttribute attrName = memberInfo [i].GetAttribute <DisplayNameAttribute> (); option.optionDisplayName = (attrName != null) ? attrName.displayName : memberInfo[i].Name; SortingOrderAttribute attrSorting = memberInfo [i].GetAttribute <SortingOrderAttribute> (); option.sortingOrder = (attrSorting != null) ? attrSorting.sortingOrder : SortingOrderAttribute.DEFAULT_SORTING_ORDER; GroupAttribute attrGroup = memberInfo [i].GetAttribute <GroupAttribute> (); string groupName = (attrGroup != null) ? attrGroup.groupName : GroupAttribute.DEFAULT_GROUP_NAME; option.memberInfo = memberInfo [i]; if (!debuggerOptionList.ContainsKey(groupName)) { debuggerOptionList.Add(groupName, new List <DebuggerOptionData> ()); } debuggerOptionList [groupName].Add(option); } }
public void AddOption(string groupName, DebuggerOptionData optData) { if (!groupList.ContainsKey(groupName)) { this.AddGroup(groupName); } groupList [groupName].AddOption(optData); }
public override void SetOptionData(DebuggerOptionData optData) { base.SetOptionData(optData); SetAction( delegate() { optData.InvokeMethod(); } ); }
public virtual void SetOptionData(DebuggerOptionData optData) { if (optData == null) { return; } this.optData = optData; if (this.textDisplayName != null) { this.textDisplayName.text = this.optData.optionDisplayName; } }
public void AddOption(DebuggerOptionData optData) { GameObject prefab = null; if (optData.IsMethod) { prefab = methodOptionPrefab; } if (optData.IsProperty) { prefab = propertyOptionPrefab; } if (prefab == null) { return; } LayoutElementOptionBase option = Instantiate(prefab, optionContainer).GetComponent <LayoutElementOptionBase>(); option.SetOptionData(optData); }
public int CompareTo(object obj) { DebuggerOptionData val = (DebuggerOptionData)obj; return(this.sortingOrder.CompareTo(val)); }