Ejemplo n.º 1
0
    public void RefreshMove()
    {
        if (m_startPoint == null)
        {
            return;
        }
        Vector3         currentPosition = m_startPoint.position;
        Quaternion      currentRotation = m_startPoint.rotation;
        RaycastMoveStep lastComputed;

        m_moveSteps.Clear();
        for (int i = 0; i < m_moves.Count; i++)
        {
            lastComputed = new RaycastMoveStep(
                currentPosition,
                currentRotation,
                m_moves[i].m_angle,
                m_moves[i].m_distanceToMove,
                m_raycastMask);
            m_moveSteps.Add(lastComputed);
            currentPosition = lastComputed.newPosition;
            currentRotation = lastComputed.newRotation;
        }
        m_totalDistance = 0;
        for (int i = 0; i < m_moveSteps.Count - 1; i++)
        {
            m_totalDistance += m_moveSteps[i].GetDistance();
        }
    }
Ejemplo n.º 2
0
    public void GetCurrentPosition(out Vector3 position, out Quaternion rotation)
    {
        position = m_startPoint.position;
        rotation = m_startPoint.rotation;
        RaycastMoveStep last = GetLast();

        if (last != null)
        {
            position = last.newPosition;
            rotation = last.newRotation;
        }
    }