示例#1
0
        protected override void GetDepsFromImpl(object obj, GetDepsFromContext context)
        {
            base.GetDepsFromImpl(obj, context);
            if (obj == null)
            {
                return;
            }

            Initialize(obj.GetType());

            PersistentArgumentCache <TID> args = new PersistentArgumentCache <TID>();

            args.GetDepsFrom(m_argumentsFieldInfo.GetValue(obj), context);

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

            AddDep(target, context);
        }
示例#2
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            if (obj == null)
            {
                m_Arguments  = default;
                m_CallState  = default;
                m_MethodName = null;
                m_Mode       = default;
                m_Target     = default;
                return;
            }

            Initialize(obj.GetType());
            m_Arguments = new PersistentArgumentCache <TID>();
            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 = ToID(target);
        }