Exemple #1
0
        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);
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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;
            }
        }
Exemple #4
0
        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);
                }
            }
        }