Exemplo n.º 1
0
        public bool TrySelect(IFrameDebugProvider provider, object metadata = null)
        {
            if (provider == null)
            {
                return(false);
            }

            FrameDebugProviderInfo providerInfo = FrameDebugProviderInfo.CreateFromProvider(provider);

            if (!m_ProviderInfos.Any(p => p.uniqueIdentifier == providerInfo.uniqueIdentifier))
            {
                return(false);
            }

            SelectedFrameDebugProvider selected = new SelectedFrameDebugProvider()
            {
                providerInfo = providerInfo,
                metadata     = metadata
            };

            int index = m_Selection.FindIndex(s => s.providerInfo.uniqueIdentifier == providerInfo.uniqueIdentifier);

            if (index >= 0)
            {
                // already selected, update metadata
                m_Selection[index] = selected;
            }
            else
            {
                m_Selection.Add(selected);
            }

            return(true);
        }
Exemplo n.º 2
0
        public void RemoveFrameDebugProvider(IFrameDebugProvider provider)
        {
            int index = m_ProviderInfos.FindIndex(info => info.uniqueIdentifier == provider.GetUniqueIdentifier());

            if (index >= 0)
            {
                FrameDebugProviderInfo info = m_ProviderInfos[index];
                info.provider          = null;
                m_ProviderInfos[index] = info;
            }

            m_Selection.RemoveAll(selected => selected.providerInfo.provider == provider);
        }
Exemplo n.º 3
0
 public abstract void UpdateRecordEntries(float time, float frameEndTime, FrameDebugProviderInfo provider);