예제 #1
0
 public void SetBuzz(int[] levels)
 {
     if (CanTestBuzzMotors)
     {
         int[] buzzCmd = BuzzMotorLvls;
         for (int f = 0; f < 5 && f < levels.Length; f++) //ensures it works even if levels is not large enough
         {
             buzzCmd[f] = Mathf.Clamp(levels[f], 0, 100);
         }
         BuzzMotorLvls = buzzCmd; //updates latest
         SenseGlove iGlove = (SenseGlove)senseGlove.GetInternalObject();
         if (iGlove != null)
         {
             iGlove.SendBuzzCmd(buzzCmd);
         }
         else
         {
             Debug.Log("Could not send Buzz command because we have no Glove");
         }
     }
 }