예제 #1
0
 /// <summary>
 /// Controls the spring / winch. Contracts if rate is positive and unwinds if negative.
 /// Springs cannot be unwound.
 /// </summary>
 /// <param name="rate">Rate of movement.</param>
 public void SetInput(float rate = 1)
 {
     if (Mathf.Abs(rate) < 0.02)
     {
         return;
     }
     if (sc.winchMode)
     {
         if (rate > 0)
         {
             sc.WinchContract(rate);
         }
         else
         {
             sc.WinchUnwind(-rate);
         }
     }
     else
     {
         try
         {
             sc.Contract(rate);
         }
         catch (System.Exception)
         {
         }
     }
 }
예제 #2
0
 /// <summary>
 ///     Controls the spring / winch. Contracts if rate is positive and unwinds if negative.
 ///     Springs cannot be unwound.
 /// </summary>
 /// <param name="rate">Rate of movement.</param>
 public void SetInput(float rate = 1)
 {
     if (Mathf.Abs(rate) < 0.02)
     {
         return;
     }
     if (_sc.winchMode)
     {
         if (rate > 0)
         {
             _sc.WinchContract(rate);
         }
         else
         {
             _sc.WinchUnwind(-rate);
         }
     }
     else
     {
         _sc.Contract(rate);
     }
 }