-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTouchTrigger.cs
33 lines (30 loc) · 1023 Bytes
/
TouchTrigger.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
namespace Unity.LEGO.Behaviours.Triggers
{
public class TouchTrigger : SensoryTrigger
{
protected override void Reset()
{
base.Reset();
m_IconPath = "Assets/LEGO/Gizmos/LEGO Behaviour Icons/Touch Trigger.png";
}
protected override void Start()
{
base.Start();
if (IsPlacedOnBrick())
{
// Add SensoryCollider to all brick colliders.
foreach (var brick in m_ScopedBricks)
{
foreach (var part in brick.parts)
{
foreach (var collider in part.colliders)
{
var sensoryCollider = LEGOBehaviourCollider.Add<SensoryCollider>(collider, m_ScopedBricks, 0.64f);
SetupSensoryCollider(sensoryCollider);
}
}
}
}
}
}
}