Exemplo n.º 1
0
        public void GetDependencies(object obj, Dictionary <long, UnityObject> dependencies)
        {
            if (obj == null)
            {
                return;
            }

            Initialize(obj.GetType());

            PersistentArgumentCache args = new PersistentArgumentCache();

            args.GetDependencies(m_argumentsFieldInfo.GetValue(obj), dependencies);

            UnityObject target = (UnityObject)m_targetFieldInfo.GetValue(obj);

            AddDependency(target, dependencies);
        }
Exemplo n.º 2
0
        public void ReadFrom(object obj)
        {
            if (obj == null)
            {
                m_Arguments  = default(PersistentArgumentCache);
                m_CallState  = default(UnityEventCallState);
                m_MethodName = null;
                m_Mode       = default(PersistentListenerMode);
                m_Target     = 0;
                return;
            }

            Initialize(obj.GetType());
            m_Arguments = new PersistentArgumentCache();
            m_Arguments.ReadFrom(m_argumentsFieldInfo.GetValue(obj));
            m_CallState  = (UnityEventCallState)m_callStatFieldInfo.GetValue(obj);
            m_MethodName = (string)m_methodNameFieldInfo.GetValue(obj);
            m_Mode       = (PersistentListenerMode)m_modeFieldInfo.GetValue(obj);
            UnityObject target = (UnityObject)m_targetFieldInfo.GetValue(obj);

            m_Target = target.GetMappedInstanceID();
        }