示例#1
0
        private void Render(CableRoute route, float radius)
        {
            if (m_segmentSpawner == null)
            {
                return;
            }

            // Let OnDrawGizmos handle rendering when in prefab edit mode.
            // It's not possible to use RuntimeObjects while there.
            if (PrefabUtils.IsPartOfEditingPrefab(gameObject))
            {
                return;
            }

            if (!Cable.RoutePointCurveUpToDate)
            {
                Cable.SynchronizeRoutePointCurve();
            }

            m_segmentSpawner.Begin();
            try {
                var points = Cable.GetRoutePoints();
                for (int i = 1; i < points.Length; ++i)
                {
                    m_segmentSpawner.CreateSegment(points[i - 1], points[i], radius);
                }
            }
            catch (System.Exception e) {
                Debug.LogException(e, this);
            }
            m_segmentSpawner.End();
        }
示例#2
0
        private void Render(CableRoute route, float radius)
        {
            if (m_segmentSpawner == null)
            {
                return;
            }

            m_segmentSpawner.Begin();
            try {
                var points = Cable.GetRoutePoints();
                for (int i = 1; i < points.Length; ++i)
                {
                    m_segmentSpawner.CreateSegment(points[i - 1], points[i], radius);
                }
            }
            catch (System.Exception e) {
                Debug.LogException(e, this);
            }
            m_segmentSpawner.End();
        }
示例#3
0
        private void RenderRoute(WireRoute route, float radius)
        {
            if (route == null)
            {
                return;
            }

            m_segmentSpawner.Begin();

            try {
                WireRouteNode[] nodes = route.ToArray();
                for (int i = 1; i < nodes.Length; ++i)
                {
                    m_segmentSpawner.CreateSegment(nodes[i - 1].Position, nodes[i].Position, radius);
                }
            }
            catch (System.Exception e) {
                Debug.LogException(e);
            }

            m_segmentSpawner.End();
        }
示例#4
0
        private void Render(CableRoute route, float radius)
        {
            if (m_segmentSpawner == null)
            {
                return;
            }

            m_segmentSpawner.Begin();
            try {
                var points = Cable.GetRoutePoints();
                for (int i = 1; i < points.Length; ++i)
                {
                    m_segmentSpawner.CreateSegment(points[i - 1], points[i], radius);
                }
                //CableRouteNode[] nodes = route.ToArray();
                //for ( int i = 1; i < nodes.Length; ++i )
                //  m_segmentSpawner.CreateSegment( nodes[ i - 1 ].Position, nodes[ i ].Position, radius );
            }
            catch (System.Exception e) {
                Debug.LogException(e, this);
            }
            m_segmentSpawner.End();
        }