public void WriteTo(UnityEventBase obj, Dictionary <long, UnityObject> objects) { if (obj == null) { return; } if (m_calls == null) { return; } object persistentCalls = Activator.CreateInstance(m_persistentCallGroupInfo.FieldType); object calls = Activator.CreateInstance(m_callsInfo.FieldType); IList list = (IList)calls; for (int i = 0; i < m_calls.Length; ++i) { PersistentPersistentCall persistentCall = m_calls[i]; if (persistentCall != null) { object call = Activator.CreateInstance(m_callType); persistentCall.WriteTo(call, objects); list.Add(call); } else { list.Add(null); } } m_callsInfo.SetValue(persistentCalls, calls); m_persistentCallGroupInfo.SetValue(obj, persistentCalls); }
public void GetDependencies(UnityEventBase obj, Dictionary <long, UnityObject> dependencies) { if (obj == null) { return; } object persistentCalls = m_persistentCallGroupInfo.GetValue(obj); if (persistentCalls == null) { return; } object calls = m_callsInfo.GetValue(persistentCalls); if (calls == null) { return; } IList list = (IList)calls; for (int i = 0; i < list.Count; ++i) { object call = list[i]; PersistentPersistentCall persistentCall = new PersistentPersistentCall(); persistentCall.GetDependencies(call, dependencies); } }
public void ReadFrom(UnityEventBase obj) { if (obj == null) { return; } object persistentCalls = m_persistentCallGroupInfo.GetValue(obj); if (persistentCalls == null) { return; } object calls = m_callsInfo.GetValue(persistentCalls); if (calls == null) { return; } IList list = (IList)calls; m_calls = new PersistentPersistentCall[list.Count]; for (int i = 0; i < list.Count; ++i) { object call = list[i]; PersistentPersistentCall persistentCall = new PersistentPersistentCall(); persistentCall.ReadFrom(call); m_calls[i] = persistentCall; } }
public void FindDependencies <T>(Dictionary <long, T> dependencies, Dictionary <long, T> objects, bool allowNulls) { if (m_calls == null) { return; } for (int i = 0; i < m_calls.Length; ++i) { PersistentPersistentCall persistentCall = m_calls[i]; if (persistentCall != null) { persistentCall.FindDependencies(dependencies, objects, allowNulls); } } }