using System; using UnityEngine; public class LineRendererSimpleFlat : MonoBehaviour { private void Start() { this.m_filter = base.gameObject.AddComponent(); this.m_render = base.gameObject.AddComponent(); } public void SetVertexCount(int f_nCount) { Mesh mesh = new Mesh(); this.m_vVert = new Vector3[f_nCount * 2 + 2]; mesh.vertices = this.m_vVert; mesh.uv = new Vector2[this.m_vVert.Length]; mesh.triangles = new int[f_nCount * 2]; mesh.RecalculateNormals(); mesh.RecalculateBounds(); this.m_filter.sharedMesh = mesh; } private void Update() { } private MeshFilter m_filter; private MeshRenderer m_render; private Vector3[] m_vVert; }