public void SetEnvironmentConstantForce()
    {
        myContantForceScript = transform.GetComponent <ConstantForceEffect>();

        /*****************************
        * Constant Force Example
        *****************************/
        //convert String to IntPtr
        IntPtr type = ConverterClass.ConvertStringToByteToIntPtr(myContantForceScript.Type);
        //Convert float[3] to intptr
        IntPtr position = ConverterClass.ConvertFloat3ToIntPtr(myContantForceScript.positionEffect);
        //Convert float[3] to intptr
        IntPtr direction = ConverterClass.ConvertFloat3ToIntPtr(myContantForceScript.directionEffect);

        //Set the effect
        PluginImport.SetEffect(type, myContantForceScript.effect_index, myContantForceScript.gain, myContantForceScript.magnitude, myContantForceScript.duration, myContantForceScript.frequency, position, direction);
        PluginImport.StartEffect(myContantForceScript.effect_index);
    }
Ejemplo n.º 2
0
    public void SetEnvironmentConstantForce()
    {
        myContantForceScript = transform.GetComponent<ConstantForceEffect>();

        /*****************************
        * Constant Force Example
        *****************************/
        //convert String to IntPtr
        IntPtr type = ConverterClass.ConvertStringToByteToIntPtr(myContantForceScript.Type);
        //Convert float[3] to intptr
        IntPtr position = ConverterClass.ConvertFloat3ToIntPtr(myContantForceScript.positionEffect);
        //Convert float[3] to intptr
        IntPtr direction = ConverterClass.ConvertFloat3ToIntPtr(myContantForceScript.directionEffect);

        //Set the effect
        PluginImport.SetEffect(type,myContantForceScript.effect_index, myContantForceScript.gain, myContantForceScript.magnitude, myContantForceScript.duration, myContantForceScript.frequency, position, direction);
        PluginImport.StartEffect(myContantForceScript.effect_index);
    }
Ejemplo n.º 3
0
 public void StopEnvironmentConstantForce()
 {
     myContantForceScript = transform.GetComponent <ConstantForceEffect>();
     PluginImport.StopEffect(myContantForceScript.effect_index);
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     cfe = GetComponent <ConstantForceEffect>();
 }