public void UpdateMesh() { bool updateFlag = false; if (m_preMeshDisposition != meshDisposition) { m_preMeshDisposition = meshDisposition; updateFlag = true; } m_dividerHeight = Mathf.Max(0.001f, m_dividerHeight); if (m_preDividerHeight != m_dividerHeight) { m_preDividerHeight = m_dividerHeight; updateFlag = true; m_pointController.PointListAverage(this.m_pathList, m_dividerHeight); } if (m_preLineWidth != m_lineWidth) { m_preLineWidth = m_lineWidth; updateFlag = true; } if (updateFlag) { Vector3[] pathUp = m_pointController.GetPathUp(m_lineWidth); Vector3[] pathDown = m_pointController.GetPathDown(m_lineWidth); m_meshFilter.mesh = CreateMesh(pathUp, pathDown); } }
public void ImitateTrail(SplineTrailRenderer trail) { emit = trail.emit; emissionDistance = trail.emissionDistance; height = trail.height; width = trail.width; vertexColor = trail.vertexColor; normal = trail.normal; meshDisposition = trail.meshDisposition; fadeType = trail.fadeType; fadeLengthBegin = trail.fadeLengthBegin; fadeLengthEnd = trail.fadeLengthEnd; maxLength = trail.maxLength; debugDrawSpline = trail.debugDrawSpline; GetComponent <Renderer>().material = trail.GetComponent <Renderer>().material; }
public void ImitateTrail(SplineTrailRenderer trail) { emit = trail.emit; emissionDistance = trail.emissionDistance; height = trail.height; width = trail.width; vertexColor = trail.vertexColor; normal = trail.normal; meshDisposition = trail.meshDisposition; fadeType = trail.fadeType; fadeLengthBegin = trail.fadeLengthBegin; fadeLengthEnd = trail.fadeLengthEnd; maxLength = trail.maxLength; debugDrawSpline = trail.debugDrawSpline; GetComponent<Renderer> ().material = trail.GetComponent<Renderer> ().material; }