12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Diagnostics;
- using UnityEngine;
- namespace Leap.Unity
- {
- public abstract class LeapProvider : MonoBehaviour
- {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public event Action<Frame> OnUpdateFrame;
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public event Action<Frame> OnFixedFrame;
- public abstract Frame CurrentFrame { get; }
- public abstract Frame CurrentFixedFrame { get; }
- public abstract Image CurrentImage { get; }
- protected void DispatchUpdateFrameEvent(Frame frame)
- {
- if (this.OnUpdateFrame != null)
- {
- this.OnUpdateFrame(frame);
- }
- }
- protected void DispatchFixedFrameEvent(Frame frame)
- {
- if (this.OnFixedFrame != null)
- {
- this.OnFixedFrame(frame);
- }
- }
- }
- }
|