mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-26 02:02:28 +08:00
add AddListener helper for IL2CPP, cleanup some unity extensions
This commit is contained in:
@ -319,12 +319,8 @@ namespace UnityExplorer.Inspectors.Reflection
|
||||
var colors = evalButton.colors;
|
||||
colors.highlightedColor = new Color(0.4f, 0.7f, 0.4f);
|
||||
evalButton.colors = colors;
|
||||
#if CPP
|
||||
evalButton.onClick.AddListener(new Action(OnMainEvaluateButton));
|
||||
#else
|
||||
evalButton.onClick.AddListener(OnMainEvaluateButton);
|
||||
#endif
|
||||
|
||||
evalButton.onClick.AddListener(OnMainEvaluateButton);
|
||||
void OnMainEvaluateButton()
|
||||
{
|
||||
if (HasParameters)
|
||||
|
@ -48,7 +48,7 @@ namespace UnityExplorer.Inspectors.Reflection
|
||||
GetLabelForValue();
|
||||
m_text.text = RichTextValue;
|
||||
|
||||
bool shouldShowInspect = !InspectorBase.IsNullOrDestroyed(this.Value, true);
|
||||
bool shouldShowInspect = !Value.IsNullOrDestroyed(true);
|
||||
if (m_inspectButton.activeSelf != shouldShowInspect)
|
||||
m_inspectButton.SetActive(shouldShowInspect);
|
||||
}
|
||||
@ -164,14 +164,11 @@ namespace UnityExplorer.Inspectors.Reflection
|
||||
var inspectText = m_inspectButton.GetComponentInChildren<Text>();
|
||||
inspectText.text = "Inspect";
|
||||
var inspectBtn = m_inspectButton.GetComponent<Button>();
|
||||
#if CPP
|
||||
inspectBtn.onClick.AddListener(new Action(OnInspectClicked));
|
||||
#else
|
||||
|
||||
inspectBtn.onClick.AddListener(OnInspectClicked);
|
||||
#endif
|
||||
void OnInspectClicked()
|
||||
{
|
||||
if (!InspectorBase.IsNullOrDestroyed(this.Value))
|
||||
if (!Value.IsNullOrDestroyed())
|
||||
InspectorManager.Instance.Inspect(this.Value);
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ namespace UnityExplorer.Inspectors
|
||||
nameInputLayout.minWidth = 100;
|
||||
nameInputLayout.minHeight = 25;
|
||||
var nameInput = nameInputObj.GetComponent<InputField>();
|
||||
nameInput.onValueChanged.AddListener(new Action<string>((string val) => { FilterMembers(val); }));
|
||||
nameInput.onValueChanged.AddListener((string val) => { FilterMembers(val); });
|
||||
m_nameFilterText = nameInput.textComponent;
|
||||
|
||||
// membertype filter
|
||||
|
Reference in New Issue
Block a user