123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using UnityEngine;
- namespace Leap.Unity
- {
- [ExecuteInEditMode]
- public abstract class IHandModel : MonoBehaviour
- {
- public event Action OnBegin;
- public event Action OnFinish;
- public bool IsTracked
- {
- get
- {
- return this.isTracked;
- }
- }
- public abstract Chirality Handedness { get; set; }
- public abstract ModelType HandModelType { get; }
- public virtual void InitHand()
- {
- }
- public virtual void BeginHand()
- {
- if (this.OnBegin != null)
- {
- this.OnBegin();
- }
- this.isTracked = true;
- }
- public abstract void UpdateHand();
- public virtual void FinishHand()
- {
- if (this.OnFinish != null)
- {
- this.OnFinish();
- }
- this.isTracked = false;
- }
- public abstract Hand GetLeapHand();
- public abstract void SetLeapHand(Hand hand);
- public virtual bool SupportsEditorPersistence()
- {
- return false;
- }
- private bool isTracked;
- }
- }
|