public void SetTangentialForce() { myTangentialForceScript = transform.GetComponent <TangentialForce>(); /***************************** * Tangential Force Example *****************************/ //convert String to IntPtr IntPtr type = ConverterClass.ConvertStringToByteToIntPtr(myTangentialForceScript.Type); //Convert float[3] to intptr IntPtr position = ConverterClass.ConvertFloat3ToIntPtr(myTangentialForceScript.positionEffect); //Convert float[3] to intptr IntPtr direction = ConverterClass.ConvertFloat3ToIntPtr(myTangentialForceScript.directionEffect); //Set the effect PluginImport.SetEffect(type, myTangentialForceScript.effect_index, myTangentialForceScript.gain, myTangentialForceScript.magnitude, myTangentialForceScript.duration, myTangentialForceScript.frequency, position, direction); PluginImport.StartEffect(myTangentialForceScript.effect_index); }
public void SetTangentialForce() { myTangentialForceScript = transform.GetComponent<TangentialForce>(); /***************************** * Tangential Force Example *****************************/ //convert String to IntPtr IntPtr type = ConverterClass.ConvertStringToByteToIntPtr(myTangentialForceScript.Type); //Convert float[3] to intptr IntPtr position = ConverterClass.ConvertFloat3ToIntPtr(myTangentialForceScript.positionEffect); //Convert float[3] to intptr IntPtr direction = ConverterClass.ConvertFloat3ToIntPtr(myTangentialForceScript.directionEffect); //Set the effect PluginImport.SetEffect(type,myTangentialForceScript.effect_index, myTangentialForceScript.gain, myTangentialForceScript.magnitude, myTangentialForceScript.duration, myTangentialForceScript.frequency, position, direction); PluginImport.StartEffect(myTangentialForceScript.effect_index); }