public void Clear()
 {
     m_Component       = null;
     m_OnDataReady     = null;
     m_GetHighestPri   = null;
     m_SurfaceObserver = null;
 }
            public SurfaceObserver                             m_SurfaceObserver; // scripting API observer

            SMComponentRecord(
                SpatialMappingBase comp,
                SpatialMappingBase.SurfaceDataReadyCallback onDataReady,
                GetHighestPriorityCallback getHighestPri,
                SurfaceObserver observer)
            {
                m_Component       = comp;
                m_OnDataReady     = onDataReady;
                m_GetHighestPri   = getHighestPri;
                m_SurfaceObserver = observer;
            }
        private int m_NextIndex = 0;                                                                // next index for the m_InFlightRequests array

        // Add the specified component to the list of components with its delegates
        // and scripting API observer.  Components are required to register with
        // the context prior to their first surface bake request.  This method will
        // throw ArgumentException if this component already exists in the list
        // ArgumentNullException if any of the parameters are missing.
        public void RegisterComponent(SpatialMappingBase smComponent, SpatialMappingBase.SurfaceDataReadyCallback onDataReady, GetHighestPriorityCallback getHighestPri, SurfaceObserver observer)
        {
            if (smComponent == null)
            {
                throw new ArgumentNullException("smComponent");
            }
            if (onDataReady == null)
            {
                throw new ArgumentNullException("onDataReady");
            }
            if (getHighestPri == null)
            {
                throw new ArgumentNullException("getHighestPri");
            }
            if (observer == null)
            {
                throw new ArgumentNullException("observer");
            }
            SMComponentRecord findResult = m_Components.Find(record => record.m_Component == smComponent);

            if (findResult.m_Component != null)
            {
                throw new ArgumentException("RegisterComponent on a component already registered!");
            }
            SMComponentRecord rec;

            rec.m_Component       = smComponent;
            rec.m_OnDataReady     = onDataReady;
            rec.m_GetHighestPri   = getHighestPri;
            rec.m_SurfaceObserver = observer;
            m_Components.Add(rec);
        }