/// <summary> /// Create a HapticHandle from this HapticPattern, passing in a given strength. /// </summary> /// <param name="strength"></param> /// <returns>A new HapticHandle</returns> public unsafe HapticHandle CreateHandle(double strength) { EventList e = new ParameterizedPattern(this).Generate((float)strength, 0f); HapticHandle.CommandWithHandle creator = delegate(HLVR_Effect * handle) { e.Transmit(handle); }; return(new HapticHandle(creator)); }
/// <summary> /// Create a HapticHandle for this HapticSequence, specifying an AreaFlag and a strength. /// </summary> /// <param name="area">The AreaFlag where this HapticSequence should play</param> /// <param name="strength">The strength of this HapticSequence (0.0-1.0)</param> /// <returns>A new HapticHandle bound to this effect playing on the given area</returns> public unsafe HapticHandle CreateHandle(AreaFlag area, double strength) { EventList e = new ParameterizedSequence(this, area).Generate((float)strength, 0f); //Debug.Log("Event List: " + e.ToString() + "\n"); HapticHandle.CommandWithHandle creator = delegate(HLVR_Effect * handle) { e.Transmit(handle); }; return(new HapticHandle(creator)); }