Exemplo n.º 1
0
        void OnDrawGizmosSelected()
        {
            if (m_portals != null)
            {
                foreach (Vector3 portal in m_portals)
                {
                    Vector3 worldPos = transform.TransformPoint(portal);
                    Gizmos.DrawIcon(worldPos, "icon_portal");
                }
            }

            if (m_waypoints != null)
            {
                for (int i = 0; i < m_waypoints.Length; ++i)
                {
                    Vector3 waypoint     = m_waypoints[i];
                    Vector3 nextWaypoint = m_waypoints[(i + 1) % m_waypoints.Length];

                    Vector3 worldPos = transform.TransformPoint(waypoint);
                    Gizmos.DrawIcon(worldPos, "icon_waypoint");

                    GizmosExtension.DrawConnectedLine(worldPos, transform.TransformPoint(nextWaypoint));
                }
            }
        }