Пример #1
0
    IEnumerator SearchCoroutine()
    {
        while (true)
        {
            if (m_kudanTracker.ArbiTrackIsTracking() && isSerching)
            {
                yield return(new WaitForSeconds(m_spawnTime));

                m_eggSpawner.Spawn();
            }
            yield return(null);
        }
    }
        void processTap()
        {
            if (!_kudanTracker.ArbiTrackIsTracking())
            {
                // from the floor placer.
                Vector3    floorPosition;                                                 // The current position in 3D space of the floor
                Quaternion floorOrientation;                                              // The current orientation of the floor in 3D space, relative to the device

                _kudanTracker.FloorPlaceGetPose(out floorPosition, out floorOrientation); // Gets the position and orientation of the floor and assigns the referenced Vector3 and Quaternion those values
                _kudanTracker.ArbiTrackStart(floorPosition, floorOrientation);            // Starts markerless tracking based upon the given floor position and orientations
            }
            else
            {
                _kudanTracker.ArbiTrackStop();
            }
        }
Пример #3
0
        /// <summary>
        /// Checks for tap controls.
        /// </summary>
        void processTap()
        {
            if (Input.touchCount == 1)
            {
                //Store input
                Touch fing = Input.GetTouch(0);

                if (fing.phase == TouchPhase.Began)                                  //If the finger started touching the screen this frame
                {
                    if (!EventSystem.current.IsPointerOverGameObject(fing.fingerId)) //And the finger on the screen is not currently touching an object
                    {
                        startPos = fing.position;                                    //Get the screen position of the finger when it hit the screen
                    }
                }
                else if (fing.phase == TouchPhase.Ended)                              //If the finger stopped touching the screen this frame
                {
                    endPos = fing.position;                                           //Get the screen position of the finger when it left the screen

                    if (Mathf.Abs(endPos.magnitude - startPos.magnitude) < roughDiff) //Calculate how far away the finger was from its starting point when it left the screen
                    {
                        tap = true;                                                   //And if it left the screen roughly where it started, it's a tap
                    }
                }
            }

            if (tap && !tracker.ArbiTrackIsTracking())
            {
                Vector3    floorPos;
                Quaternion floorRot;

                tracker.FloorPlaceGetPose(out floorPos, out floorRot);
                tracker.ArbiTrackStart(floorPos, floorRot);

                tap = false;
            }
        }