Ejemplo n.º 1
0
 void Start()
 {
     device                 = PhontrollerService.Instance.loadDevice(deviceId);
     device.OnConnected    += HandleOnConnected;
     device.OnDisconnected += HandleOnDisconnected;;
     InitFingers();
 }
Ejemplo n.º 2
0
        public void OnPhontrollerDataPacket(PhontrollerDataPacket data)
        {
            // get the device
            PhontrollerDevice device = loadDevice(data.id);

            device.SetData(data);
        }
 void Start()
 {
     device = PhontrollerService.Instance.loadDevice(deviceId);
     device.OnConnected += HandleOnConnected;
     device.OnDisconnected += HandleOnDisconnected;;
     InitFingers();
 }
 public PhontrollerDevice loadDevice(int id)
 {
     if (!devices.ContainsKey(id))
     {
         devices[id] = new PhontrollerDevice(id);
     }
     return devices[id];
 }
Ejemplo n.º 5
0
 public PhontrollerDevice loadDevice(int id)
 {
     if (!devices.ContainsKey(id))
     {
         devices[id] = new PhontrollerDevice(id);
     }
     return(devices[id]);
 }
        // show/hide our finger objects based on touches
        void UpdateFingers(PhontrollerDevice.TouchPoint[] touches, float TouchesMaxWidth, float TouchesMaxHeight)
        {
            for (int i = 0; i < touches.Length; i++)
            {
                if (touches[i].isPressed)
                {
                    fingers[i].gameObject.SetActive(true);
                    // position it from
                    float x = touches[i].position.x / TouchesMaxWidth - 0.5f;
                    float y = touches[i].position.y / TouchesMaxHeight - 0.5f;

                    fingers[i].gameObject.transform.localPosition = Vector3.Scale(new Vector3(-x, y, -0.06f), FingersScale);
                }
                else
                {
                    fingers[i].gameObject.SetActive(false);
                }
            }
        }
 void PhontrollerDisonnected(PhontrollerDevice device)
 {
     IntroMessage.SetActive(true);
     RecenterMessage.SetActive(false);
 }