コード例 #1
0
    private void Update()
    {
        if (!_doubleTapEnabled)
        {
            return;
        }

#if UNITY_EDITOR || UNITY_STANDALONE_WIN
        // When clicking, start a timer to check for a 2nd click.
        if (Input.GetMouseButtonDown(0))
        {
            _clickCount++;
            StartCoroutine(DoubleClickTimer());
        }

        if (_clickCount == 2)
        {
            _clickCount = 0;

            PhotoCameraApi.CreatePhoto();
        }
#endif

#if UNITY_ANDROID
        foreach (Touch touch in Input.touches)
        {
            if (touch.tapCount == 2)
            {
                PhotoCameraApi.CreatePhoto();

                return;
            }
        }
#endif
    }
コード例 #2
0
    private IEnumerator HidePhotoRoutine()
    {
        yield return(new WaitForSeconds(_photoScreenTime));

        // Disable the foreground and backdrop images to reduce draw calls.
        _foregroundImage.enabled = false;
        _backdrop.enabled        = false;

        PhotoCameraApi.ShowPhotoFinished();
    }
コード例 #3
0
    private void Awake()
    {
        PhotoCameraApi.OnCreatePhoto += () =>
        {
            GameObject foundObject = CheckObject();

            if (!foundObject)
            {
                return;
            }

            for (int i = 0; i < Properties.currentFindableItems.Length; i++)
            {
                if (Properties.currentFindableItems[i].model == foundObject)
                {
                    PhotoCameraApi.FoundObject(i);
                    break;
                }
            }
        };
    }
コード例 #4
0
    private void CreatePhoto()
    {
        _foregroundImage.texture = ToTexture2D(_renderTexture);

        PhotoCameraApi.ShowPhoto();
    }