Пример #1
0
 public void Submit(string key, PositionType position, DotPoint point, int durationMillis)
 {
     Submit(key, position, new List <DotPoint>()
     {
         point
     }, durationMillis);
 }
 private bool RemoveAtList(DotPoint dot)
 {
     if (dotPointList.Contains(dot))
     {
         dotPointList.Remove(dot);
         return(true);
     }
     return(false);
 }
 private bool AddToList(DotPoint dot)
 {
     if (dotPointList.Contains(dot))
     {
         return(false);
     }
     dotPointList.Add(dot);
     return(true);
 }
Пример #4
0
        public void Submit(string key, PositionType position, List <DotPoint> points, int durationMillis)
        {
            byte[] bytes = new byte[20];
            for (var i = 0; i < points.Count; i++)
            {
                DotPoint point = points[i];
                bytes[point.Index] = (byte)point.Intensity;
            }

            HapticApi.SubmitByteArray(key, position, bytes, 20, durationMillis);
        }
 public void Toggle(DotPoint dot)
 {
     if (dotPointList.Contains(dot))
     {
         RemoveAtList(dot);
     }
     else
     {
         AddToList(dot);
     }
 }
Пример #6
0
 public void Submit(string key, PositionType position, DotPoint point, int durationMillis)
 {
     // nothing to do
 }
 void Awake()
 {
     dotPoint   = new DotPoint(motorIndex, motorIntensity);
     controller = GetComponentInParent <BhapticsDotPointControllerExample>();
     thisButton = GetComponent <Button>();
 }