TrueSync
LayerCollisionMatrix.cs
1 using UnityEngine;
2 
3 namespace TrueSync {
4 
8  public class LayerCollisionMatrix {
9 
16  public static bool CollisionEnabled(int layerA, int layerB) {
18  if (tsConfig == null) {
19  return true;
20  }
21 
22  return !tsConfig.GetIgnoreLayerCollision(layerA, layerB);
23  }
24 
31  public static bool CollisionEnabled(GameObject goA, GameObject goB) {
32  return CollisionEnabled(goA.layer, goB.layer);
33  }
34 
35  }
36 
37 }
Manages the collision matrix of physics simulation.
Manages creation of player prefabs and lockstep execution.
bool GetIgnoreLayerCollision(int layerA, int layerB)
Returns true if the collision between layerA and layerB should be ignored.
static TrueSyncConfig Config
Returns the active TrueSyncConfig used by the TrueSyncManager.
static bool CollisionEnabled(GameObject goA, GameObject goB)
Returns true if the given GameObjects can collide (based on its layers).
Represents a set of configurations for TrueSync.
static bool CollisionEnabled(int layerA, int layerB)
Returns true if the given layers can collide.