You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
872 B
42 lines
872 B
|
1 month ago
|
using System;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace UDE_HAND_INTERACTION
|
||
|
|
{
|
||
|
|
public enum DetectorEventType
|
||
|
|
{
|
||
|
|
Hover,
|
||
|
|
Unhover,
|
||
|
|
Select,
|
||
|
|
Unselect,
|
||
|
|
Move,
|
||
|
|
Cancel
|
||
|
|
}
|
||
|
|
|
||
|
|
public struct DetectorEvent
|
||
|
|
{
|
||
|
|
public int Identifier { get; }
|
||
|
|
public DetectorEventType Type { get; }
|
||
|
|
public Pose Pose { get; }
|
||
|
|
public object Data { get; }
|
||
|
|
|
||
|
|
public DetectorEvent(int identifier, DetectorEventType type, Pose pose, object data = null)
|
||
|
|
{
|
||
|
|
Identifier = identifier;
|
||
|
|
Type = type;
|
||
|
|
Pose = pose;
|
||
|
|
Data = data;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public interface IDetectable
|
||
|
|
{
|
||
|
|
event Action<DetectorEvent> WhenDetectorEventRaised;
|
||
|
|
}
|
||
|
|
|
||
|
|
public interface IDetectableElement : IDetectable
|
||
|
|
{
|
||
|
|
void ProcessDetectorEvent(DetectorEvent evt);
|
||
|
|
}
|
||
|
|
}
|