Documentation for the Unity C# Library
Loading...
Searching...
No Matches
LaserMovableWithOutline.cs
Go to the documentation of this file.
1using Autohand;
2using JJKeller;
3using UnityEngine;
4
5namespace PixoVR.Event
6{
8 {
9 [SerializeField] private Outline _highlightOutline;
10 [SerializeField] private Color _targetingColor;
11 [SerializeField] private Color _pullingColor;
13 public override void Awake()
14 {
15 base.Awake();
16 _highlightOutline.enabled = false;
17 }
18
19 public override void StartTargeting()
20 {
21 base.StartTargeting();
22 _highlightOutline.enabled = true;
23 _highlightOutline.OutlineColor = _targetingColor;
24 }
25
26 public override void StopTargeting()
27 {
28 base.StopTargeting();
29 _highlightOutline.enabled = false;
30 }
31
32 public override void OnTriggerGrab(Hand hand, Grabbable grabbable)
33 {
34 base.OnTriggerGrab(hand, grabbable);
36 {
37 _highlightOutline.OutlineColor = _pullingColor;
38 }
39 }
40
41 public override void OnTriggerReleased(Hand hand, Grabbable grabbable)
42 {
43 base.OnTriggerReleased(hand, grabbable);
44 _highlightOutline.OutlineColor = _targetingColor;
45 }
46 }
47}
override void OnTriggerGrab(Hand hand, Grabbable grabbable)
override void OnTriggerReleased(Hand hand, Grabbable grabbable)