Example #1
0
        public SerializedProxyNodeFeedback OnSerializePreferences()
        {
            if (m_RequestData.Count == 0)
            {
                return(m_SerializedFeedback);
            }

            if (m_SerializedFeedback == null)
            {
                m_SerializedFeedback = new SerializedProxyNodeFeedback();
            }

            var keys   = new List <RequestKey>();
            var values = new List <RequestData>();

            foreach (var kvp in m_RequestData)
            {
                var requestKey = kvp.Key;
                if (!requestKey.HasTooltip())
                {
                    continue;
                }

                keys.Add(requestKey);
                values.Add(kvp.Value);
            }

            m_SerializedFeedback.keys   = keys.ToArray();
            m_SerializedFeedback.values = values.ToArray();

            return(m_SerializedFeedback);
        }
Example #2
0
        public void OnDeserializePreferences(object obj)
        {
            if (obj == null)
            {
                return;
            }

            m_SerializedFeedback = (SerializedProxyNodeFeedback)obj;
            if (m_SerializedFeedback.keys == null)
            {
                return;
            }

            var length = m_SerializedFeedback.keys.Length;
            var keys   = m_SerializedFeedback.keys;
            var values = m_SerializedFeedback.values;

            for (var i = 0; i < length; i++)
            {
                m_RequestData[keys[i]] = values[i];
            }
        }