23 lines
510 B
C#
Raw Permalink Normal View History

2025-07-11 15:42:48 +05:00
using UnityEngine;
namespace MenteBacata.ScivoloCharacterController.Internal
{
public static class GameObjectExtensions
{
public static LayerMask GetCollisionMask(this GameObject gameObject)
{
int mask = 0;
for (int i = 0; i < 32; i++)
{
if (!Physics.GetIgnoreLayerCollision(gameObject.layer, i))
{
mask |= (1 << i);
}
}
return mask;
}
}
}