void ScreenShot()
    {
        if (infoText)
        {
            infoText.text = "Hand grip detected.";
        }

        //StartCoroutine(CountdownAndTakePicture());
        PhotoShooter photoShooter = gameObject.GetComponent <PhotoShooter> ();

        if (photoShooter && photoShooter.enabled)
        {
            photoShooter.CountdownAndMakePhoto();
        }
    }
    // InteractionListenerInterface

    public void HandGripDetected(long userId, int userIndex, bool isRightHand, bool isHandInteracting, Vector3 handScreenPos)
    {
        if (userIndex != playerIndex)
        {
            return;
        }

        if (isRightHand && handScreenPos.y >= 0.5f)
        {
            if (infoText)
            {
                infoText.text = "Hand grip detected.";
            }

            //StartCoroutine(CountdownAndTakePicture());
            PhotoShooter photoShooter = gameObject.GetComponent <PhotoShooter>();
            if (photoShooter && photoShooter.enabled)
            {
                photoShooter.CountdownAndMakePhoto();
            }
        }
    }
    void Update()
    {
        KinectManager manager = KinectManager.Instance;

        if (manager && manager.IsInitialized())
        {
            if (backgroundImage && (backgroundImage.texture == null))
            {
                backgroundImage.texture = manager.GetUsersClrTex();
            }
        }

        if (currentIndex != prevIndex)
        {
            prevIndex = currentIndex;

            if (headOverlayer && headMasks != null)
            {
                if (headOverlayer.overlayObject)
                {
                    headOverlayer.overlayObject.rotation = headOverlayer.initialRotation;
                    headOverlayer.overlayObject.gameObject.SetActive(false);
                }

                headOverlayer.overlayObject = currentIndex >= 0 && currentIndex < headMasks.Length ? headMasks [currentIndex] : null;
                headOverlayer.playerIndex   = playerIndex;

                if (headOverlayer.overlayObject)
                {
                    headOverlayer.overlayObject.gameObject.SetActive(true);
                }

                headOverlayer.Start();
            }

            if (leftHandOverlayer && leftHandMasks != null)
            {
                if (leftHandOverlayer.overlayObject)
                {
                    leftHandOverlayer.overlayObject.rotation = leftHandOverlayer.initialRotation;
                    leftHandOverlayer.overlayObject.gameObject.SetActive(false);
                }

                leftHandOverlayer.overlayObject = currentIndex >= 0 && currentIndex < leftHandMasks.Length ? leftHandMasks [currentIndex] : null;
                leftHandOverlayer.playerIndex   = playerIndex;

                if (leftHandOverlayer.overlayObject)
                {
                    leftHandOverlayer.overlayObject.gameObject.SetActive(true);
                }

                leftHandOverlayer.Start();
            }

            if (chestOverlayer && chestMasks != null)
            {
                if (chestOverlayer.overlayObject)
                {
                    chestOverlayer.overlayObject.rotation = chestOverlayer.initialRotation;
                    chestOverlayer.overlayObject.gameObject.SetActive(false);
                }

                chestOverlayer.overlayObject = currentIndex >= 0 && currentIndex < chestMasks.Length ? chestMasks [currentIndex] : null;
                chestOverlayer.playerIndex   = playerIndex;

                if (chestOverlayer.overlayObject)
                {
                    chestOverlayer.overlayObject.gameObject.SetActive(true);
                }

                chestOverlayer.Start();
            }
        }

        if (Input.GetKeyDown(KeyCode.T))
        {
            if (infoText)
            {
                infoText.text = "Hand grip detected.";
            }

            //StartCoroutine(CountdownAndTakePicture());
            PhotoShooter photoShooter = gameObject.GetComponent <PhotoShooter> ();
            if (photoShooter && photoShooter.enabled)
            {
                photoShooter.CountdownAndMakePhoto();
            }
        }
    }