Hello, I’m trying to find a way to access value of argument passed to Persistent Listener added to UnityEvent using inspector.
Example:
using UnityEngine;
using UnityEngine.Events;
public class EventTester : MonoBehaviour {
public UnityEvent ev;
}
‘Ev’ contains one Persistent Listener, its target is some GameObject, called method is SetActive, argument passed to method is true, what I’m trying to get is ‘true’ passed to SetActive.
This value is saved in scene file like this:
ev:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2030264660}
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
but I can’t find any way to get this value without parsing such file.
Is there any way to, for example using reflection, get access to m_Calls array?