Pyramid scene now turns-off contact capture for all the bricks. This gives a performance boost.

This commit is contained in:
Melvyn May 2022-11-08 14:27:30 +00:00
Родитель ce99c9703d
Коммит 7ee0a9cb3f
3 изменённых файлов: 47 добавлений и 6 удалений

Просмотреть файл

@ -105,7 +105,7 @@ NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
@ -118,7 +118,7 @@ NavMeshSettings:
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
@ -264,6 +264,25 @@ BoxCollider2D:
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
@ -337,7 +356,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 2
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4721923257449676, guid: de56f1443e496f4408095248d6b6f0fd, type: 3}
@ -378,7 +397,9 @@ PrefabInstance:
value: 256
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: de56f1443e496f4408095248d6b6f0fd, type: 3}
--- !u!1 &986197327
GameObject:
@ -529,6 +550,11 @@ MonoBehaviour:
m_MaxScale: 0.05
m_GravityScale: 1
m_RandomRotation: 0
m_SleepMode: 1
m_CollisionMode: 0
ContactCaptureLayers:
serializedVersion: 2
m_Bits: 0
m_PhysicsMaterial: {fileID: 6200000, guid: 8af2ed97ea7f87540b0b1ac7cc710ad9, type: 2}
m_SpawnParent: {fileID: 0}
m_SpawnItem: {fileID: 5399772162092463286, guid: 5d2d85cada350ff46b25022887993793,
@ -582,9 +608,17 @@ Camera:
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0

Просмотреть файл

@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 6fd71a2bbf89af14396bac1511646a91
timeCreated: 1488980840
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -30,6 +30,8 @@ public class SpawnPyramid : MonoBehaviour
public RigidbodySleepMode2D m_SleepMode = RigidbodySleepMode2D.NeverSleep;
public CollisionDetectionMode2D m_CollisionMode = CollisionDetectionMode2D.Discrete;
public LayerMask ContactCaptureLayers = Physics2D.AllLayers;
public PhysicsMaterial2D m_PhysicsMaterial;
public Transform m_SpawnParent;
@ -73,6 +75,12 @@ public class SpawnPyramid : MonoBehaviour
body.collisionDetectionMode = m_CollisionMode;
}
var collider = spawnObj.GetComponent<Collider2D>();
if (collider)
{
collider.contactCaptureLayers = ContactCaptureLayers;
}
x += m_SpacingX;
}