add AddListener helper for IL2CPP, cleanup some unity extensions

This commit is contained in:
sinaioutlander
2020-11-13 23:14:57 +11:00
parent eedb7dd76f
commit eb693eceb5
23 changed files with 136 additions and 282 deletions

View File

@ -45,7 +45,7 @@ namespace UnityExplorer.Inspectors
#endif
UnityEngine.Object unityObj = obj as UnityEngine.Object;
if (InspectorBase.IsNullOrDestroyed(obj))
if (obj.IsNullOrDestroyed())
{
return;
}
@ -289,11 +289,9 @@ namespace UnityExplorer.Inspectors
// var applyBtnObj = UIFactory.CreateButton(timeGroupObj);
// var applyBtn = applyBtnObj.GetComponent<Button>();
//#if MONO
// applyBtn.onClick.AddListener(SetTimeScale);
//#else
// applyBtn.onClick.AddListener(new Action(SetTimeScale));
//#endif
// var applyText = applyBtnObj.GetComponentInChildren<Text>();
// applyText.text = "Apply";
// applyText.fontSize = 14;
@ -323,11 +321,8 @@ namespace UnityExplorer.Inspectors
var inspectText = inspectObj.GetComponentInChildren<Text>();
inspectText.text = "Mouse Inspect";
inspectText.fontSize = 13;
#if MONO
inspectBtn.onClick.AddListener(OnInspectMouseClicked);
#else
inspectBtn.onClick.AddListener(new Action(OnInspectMouseClicked));
#endif
void OnInspectMouseClicked()
{