예제 #1
0
    public void SetFFB(int[] levels)
    {
        if (CanTestFFB)
        {
            int[] FFBcmd = FFBLvls;
            for (int f = 0; f < 5 && f < levels.Length; f++) //ensures it works even if levels is not large enough
            {
                FFBcmd[f] = Mathf.Clamp(levels[f], 0, 100);
            }
            FFBLvls = FFBcmd; //updates latest

            SenseGlove iGlove = (SenseGlove)senseGlove.GetInternalObject();
            if (iGlove != null)
            {
                iGlove.BrakeCmd(FFBcmd);
            }
            else
            {
                Debug.Log("Could not send FFB command because we have no Glove");
            }
        }
    }