/// <summary>
 /// Observable ValueChanged event
 /// </summary>
 /// <param name="events"></param>
 /// <returns></returns>
 public static IObservable <Control3DEventArgs> ValueChangedAsObservable(this VRTK_SpringLever events)
 {
     return(Observable.FromEvent <Control3DEventHandler, Control3DEventArgs>(
                h => (s, e) => h(e),
                h => events.ValueChanged += h,
                h => events.ValueChanged -= h));
 }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        if (instance != this)
        {
            Destroy(gameObject);
        }

        start   = false;
        rotator = GetComponentInChildren <VRTK_SpringLever>();
    }