예제 #1
0
 public void SetListenner(string id, IIMUEventDelegate imu, IButtonEventDelegate button)
 {
     if (string.IsNullOrEmpty(id))
     {
         return;
     }
     if (imu != null)
     {
         if (sensorEventDict.ContainsKey(id))
         {
             sensorEventDict[id] = imu; // update
         }
         else
         {
             sensorEventDict.Add(id, imu); // new
         }
     }
     if (button != null)
     {
         if (buttonEventDict.ContainsKey(id))
         {
             buttonEventDict[id] = button; // update
         }
         else
         {
             buttonEventDict.Add(id, button); // new
         }
     }
 }
예제 #2
0
 public void AddListenner(string id, IIMUEventDelegate imu, IButtonEventDelegate button)
 {
     if (string.IsNullOrEmpty(id))
     {
         return;
     }
     if (!sensorEventDict.ContainsKey(id) && imu != null)
     {
         sensorEventDict.Add(id, imu);
     }
     if (!buttonEventDict.ContainsKey(id) && button != null)
     {
         buttonEventDict.Add(id, button);
     }
 }