using UnityEngine;
namespace ECE
{
///
/// Properties to use when creating a collider.
///
public struct EasyColliderProperties
{
///
/// Marks the collider's isTrigger property
///
public bool IsTrigger;
///
/// Layer of gameobject when creating a rotated collider.
///
public int Layer;
#if (UNITY_6000_0_OR_NEWER)
///
/// Physic material to set on collider.
///
public PhysicsMaterial PhysicMaterial;
#else
///
/// Physic material to set on collider.
///
public PhysicMaterial PhysicMaterial;
public void SetPhysicMat(PhysicMaterial physmat)
{
PhysicMaterial = physmat;
}
#endif
#if (UNITY_2022_2_OR_NEWER)
///
/// whether or not the collidere generates contacts for physics.contact event.
///
public bool ProvidesContacts;
///
/// layer overrides - layer override priority property on a collider.
///
public int LayerOverridePriority;
///
/// layer overrides exclude layer mask property on colliders.
///
public LayerMask ExcludeLayers;
///
/// layer overrides include layer mask property on colliders.
///
public LayerMask IncludeLayers;
#endif
///
/// Orientation of created collider.
///
public COLLIDER_ORIENTATION Orientation;
///
/// Gameobject collider gets added to.
///
public GameObject AttachTo;
///
/// Properties with which to create a collider
///
/// Should the collider's isTrigger property be true?
/// Layer of gameobject when creating a rotated collider
/// Physic Material to apply to a collider
/// GameObject to attach the collider to
/// Orientation of the collider for generation
public EasyColliderProperties(bool isTrigger, int layer,
#if (UNITY_6000_0_OR_NEWER)
PhysicsMaterial physicMaterial,
#else
PhysicMaterial physicMaterial,
#endif
GameObject attachTo, COLLIDER_ORIENTATION orientation = COLLIDER_ORIENTATION.NORMAL)
{
IsTrigger = isTrigger;
Layer = layer;
PhysicMaterial = physicMaterial;
AttachTo = attachTo;
Orientation = orientation;
#if (UNITY_2022_2_OR_NEWER)
ProvidesContacts = false;
LayerOverridePriority = 0;
IncludeLayers = 0;
ExcludeLayers = 0;
#endif
}
}
}