Example #1
0
    /*
     * In the Start function we initialize the Filter MonoBehaviour component that will the auto-update variable being filtered.
     * Then we assign initial values to it: Input script, that supplies the filter with input values, alpha parameter and initial value for the filter.
     */
    void Start()
    {
        float a = Parameters.a;

        lowPassFilterMonoBehaviour = gameObject.AddComponent <LowPassFilterMonoBehaviour>();
        lowPassFilterMonoBehaviour.Set <Vector3>(new MouseInput(), a, Vector3.zero);
    }
Example #2
0
    /*
     * In the Start function we initialize the Filter MonoBehaviour component that will the auto-update variable being filtered.
     * Then we assign initial values to it: Input script, that supplies the filter with input values, alpha parameter and initial value for the filter.
     */
    void Start()
    {
        float a = GetComponent <AccelerometerObjectControl>().a; // a hack to easily set value from the AccelerometerObjectControl component - don't do this, You should specify it somewhere instead, perhaps in a config class

        lowPassFilterMonoBehaviour = gameObject.AddComponent <LowPassFilterMonoBehaviour>();
        lowPassFilterMonoBehaviour.Set <Vector3>(new AccelerometerInput(), a, Vector3.zero);
    }