-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommon.Physics.cs
61 lines (52 loc) · 1.82 KB
/
Common.Physics.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.Collections.Generic;
using UnityEngine;
namespace VirtueSky.Misc
{
public static partial class Common
{
#region IgnoreCollision
public static void IgnoreCollision(List<Collider> _listCollider, Collider _collider)
{
_listCollider.ForEach(col => { Physics.IgnoreCollision(col, _collider); });
}
public static void IgnoreCollision(Collider _collider, List<Collider> _listCollider)
{
_listCollider.ForEach(col => { Physics.IgnoreCollision(col, _collider); });
}
public static void IgnoreCollision(List<Collider> _listCollider1, List<Collider> _listCollider2)
{
foreach (var VARIABLE1 in _listCollider1)
{
foreach (var VARIABLE2 in _listCollider2)
{
Physics.IgnoreCollision(VARIABLE1, VARIABLE2);
}
}
}
public static void IgnoreCollision2D(List<Collider2D> _listCollider, Collider2D _collider)
{
foreach (var VARIABLE in _listCollider)
{
Physics2D.IgnoreCollision(VARIABLE, _collider);
}
}
public static void IgnoreCollision2D(Collider2D _collider, List<Collider2D> _listCollider)
{
foreach (var VARIABLE in _listCollider)
{
Physics2D.IgnoreCollision(VARIABLE, _collider);
}
}
public static void IgnoreCollision2D(List<Collider2D> _listCollider1, List<Collider2D> _listCollider2)
{
foreach (var VARIABLE1 in _listCollider1)
{
foreach (var VARIABLE2 in _listCollider2)
{
Physics2D.IgnoreCollision(VARIABLE1, VARIABLE2);
}
}
}
#endregion
}
}