rabidus-test/Assets/BNG Framework/Scripts/Helpers/IgnoreColliders.cs

22 lines
618 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BNG {
public class IgnoreColliders : MonoBehaviour {
public List<Collider> CollidersToIgnore;
// Start is called before the first frame update
void Start() {
var thisCol = GetComponent<Collider>();
if(CollidersToIgnore != null) {
foreach(var col in CollidersToIgnore) {
if(col && col.enabled) {
Physics.IgnoreCollision(thisCol, col, true);
}
}
}
}
}
}