private HapticHandle CreateHandle(SideOfHaptic side) { HapticHandle handle = null; if (TypeOfPlayable == PlayableType.Sequence) { HapticSequence seq = new HapticSequence(); seq.LoadFromAsset(PlayableResourceName); var areaFlag = side == SideOfHaptic.Left ? Where.Mirror() : Where; handle = seq.CreateHandle(areaFlag); } else if (TypeOfPlayable == PlayableType.Pattern) { HapticPattern pat = new HapticPattern(); pat.LoadFromAsset(PlayableResourceName); handle = pat.CreateHandle(); } else if (TypeOfPlayable == PlayableType.Experience) { HapticExperience exp = new HapticExperience(); exp.LoadFromAsset(PlayableResourceName); handle = exp.CreateHandle(); } else if (TypeOfPlayable == PlayableType.Impulse) { return(CreateImpulseHandle(side)); } return(handle); }
private void Start() { hapticOnDrawback.LoadFromAsset(drawHaptic); hapticOnRelease.LoadFromAsset(releaseHaptic); hapticwhilePulled.LoadFromAsset(pulledHapticName); pulledHandle = hapticwhilePulled.CreateHandle(); bowAnimation = GetComponent <BowAnimation>(); handle = GetComponentInChildren <BowHandle>(); interact = GetComponent <VRTK_InteractableObject>(); interact.InteractableObjectGrabbed += new InteractableObjectEventHandler(DoObjectGrab); }