Example #1
0
        /// <summary>
        ///   Calibrates the specified movement using current positions.
        /// </summary>
        ///
        /// <param name="movement">The movement to be calibrated.</param>
        ///
        public virtual void Calibrate(FaceMovement movement)
        {
            switch (movement)
            {
            case FaceMovement.Left:
                XAxisMin = rawX;
                break;

            case FaceMovement.Right:
                XAxisMax = rawX;
                break;

            case FaceMovement.Up:
                YAxisMax = rawY;
                break;

            case FaceMovement.Down:
                YAxisMin = rawY;
                break;
            }
        }
Example #2
0
    public void CreateFace()
    {
        //Create faces in the "wings"

        for (int i = 0; i < 1; i++)
        {
            pos = Random.Range(0, 2);
            if (pos == 0)
            {
                Debug.Log("Left");
                person         = GameObject.Instantiate(people[Random.Range(0, people.Length)], new Vector3(spawnLeft.transform.position.x, spawnLeft.transform.position.y, spawnLeft.transform.position.z), transform.rotation);
                movementScript = person.GetComponent <FaceMovement>();
                StartCoroutine(movementScript.moveRight(person));
            }
            else
            {
                Debug.Log("Right");
                person         = GameObject.Instantiate(people[Random.Range(0, people.Length)], new Vector3(spawnRight.transform.position.x, spawnRight.transform.position.y, spawnRight.transform.position.z), transform.rotation);
                movementScript = person.GetComponent <FaceMovement>();
                StartCoroutine(movementScript.moveLeft(person));
            }
        }
    }
Example #3
0
 void Start()
 {
     faceMovement = GetComponent <FaceMovement>();
     rb           = GetComponent <Rigidbody>();
 }
Example #4
0
        /// <summary>
        ///   Calibrates the specified movement using current positions.
        /// </summary>
        /// 
        /// <param name="movement">The movement to be calibrated.</param>
        /// 
        public virtual void Calibrate(FaceMovement movement)
        {
            switch (movement)
            {
                case FaceMovement.Left:
                    XAxisMin = rawX;
                    break;

                case FaceMovement.Right:
                    XAxisMax = rawX;
                    break;

                case FaceMovement.Up:
                    YAxisMax = rawY;
                    break;

                case FaceMovement.Down:
                    YAxisMin = rawY;
                    break;
            }
        }