protected override void OnSurfaceDataReady(SpatialMappingBase requester, SurfaceData bakedData, bool outputWritten, float elapsedBakeTimeSeconds) { SpatialMappingBase.Surface surface; if (base.surfaceObjects.TryGetValue(bakedData.id.handle, out surface)) { surface.awaitingBake = false; if (outputWritten) { if (surface.gameObject == null) { Debug.LogError($"A SpatialMappingRenderer component can not apply baked data to a surface with id " { bakedData.id.handle } " because its GameObject is null."); } else { if (requester != this) { base.CloneBakedComponents(bakedData, surface); } if (surface.meshRenderer == null) { surface.meshRenderer = surface.gameObject.GetComponent <MeshRenderer>(); if (surface.meshRenderer == null) { surface.meshRenderer = surface.gameObject.AddComponent <MeshRenderer>(); } surface.meshRenderer.receiveShadows = false; surface.meshRenderer.shadowCastingMode = ShadowCastingMode.Off; } this.ApplyRenderSettings(surface.meshRenderer); } } } }
protected override void OnSurfaceDataReady(SpatialMappingBase requester, SurfaceData bakedData, bool outputWritten, float elapsedBakeTimeSeconds) { SpatialMappingBase.Surface surface; if (base.surfaceObjects.TryGetValue(bakedData.id.handle, out surface)) { surface.awaitingBake = false; if (outputWritten) { if (surface.gameObject == null) { Debug.LogError($"A SpatialMappingCollider component can not apply baked data to the surface with id " { bakedData.id.handle } " because its GameObject is null."); } else if (bakedData.outputCollider != null) { if (requester != this) { base.CloneBakedComponents(bakedData, surface); } bakedData.outputCollider.gameObject.layer = this.layer; if (this.material != null) { bakedData.outputCollider.material = this.material; } } } } }
protected virtual void OnEnable() { this.m_SMBase = base.target as SpatialMappingBase; this.m_SurfaceParentProp = base.serializedObject.FindProperty("m_SurfaceParent"); this.m_FreezeUpdatesProp = base.serializedObject.FindProperty("m_FreezeUpdates"); this.m_SecondsBetweenUpdatesProp = base.serializedObject.FindProperty("m_SecondsBetweenUpdates"); this.m_NumUpdatesBeforeRemovalProp = base.serializedObject.FindProperty("m_NumUpdatesBeforeRemoval"); this.m_LodProp = base.serializedObject.FindProperty("m_LodType"); this.m_VolumeProp = base.serializedObject.FindProperty("m_VolumeType"); this.m_SphereRadiusProp = base.serializedObject.FindProperty("m_SphereRadius"); this.m_HalfBoxExtentsProp = base.serializedObject.FindProperty("m_HalfBoxExtents"); }
public void DeregisterComponent(SpatialMappingBase smComponent) {