Ejemplo n.º 1
0
    public void Update()
    {
        if ((Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)) & m_isLookedAt)
        {
            //Debug.Log("Pressed left click.");
            // m_moveDirection = transform.TransformDirection(m_GazeBase);
            if (!m_ScreenFade.IsFading)
            {
                m_ScreenFade.StartScreenFadeOut(this, m_moveTo);
            }
            //m_isMoving = true;
        }

        /*if (m_isMoving)
         * {
         *  Vector3 desiredPosition = m_moveTo.transform.position;
         *  float distance = Vector3.Distance(desiredPosition, m_Camera.transform.position);
         *  if (distance>0.01) // desiredPosition != m_Camera.transform.position
         *  {
         *      m_Camera.transform.position = Vector3.MoveTowards(m_Camera.transform.position, desiredPosition, distance*m_speed);
         *      //stupidCounter++;
         *      /*if (stupidCounter>30)
         *      {
         *          m_isMoving = false;
         *          stupidCounter = 0;
         *          desiredPosition = m_Camera.transform.position;
         *      }
         *  } else {
         *      m_isMoving = false;
         *  }
         * }*/
    }