LayerCollisionHandler.cs 512 B

123456789101112131415161718192021222324
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class LayerCollisionHandler : MonoBehaviour
  5. {
  6. public int[] ignoreLayers;
  7. private bool recursiveIgnore;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. foreach (int layer in ignoreLayers)
  12. {
  13. Physics.IgnoreLayerCollision(this.gameObject.layer,layer);
  14. }
  15. }
  16. // Update is called once per frame
  17. void Update()
  18. {
  19. }
  20. }