public void Draw(LineSettings currentSetting) { settings = currentSetting; if (!enabled || settings.paths.Length <= 0 || settings.paths.Any(t => t == null)) { return; } IReadOnlyList <Vector3> vecPaths = settings.paths.Select(t => t.position).ToList(); InitMaterial(); lineMaterial.SetPass(0); GL.PushMatrix(); { GL.Begin(GL.QUADS); { GL.Color(settings.color); if (_settings.Equals(settings) && _paths.SequenceEqual(vecPaths)) { Debug.Log("nonUpdated"); DotVertexes(currentPaths.ToArray()); } else { Debug.Log("Updated"); currentPaths.Clear(); _settings = settings; _paths = vecPaths; Vector3 v0, v1, o; relativeWidth = 1.0f / Screen.width * settings.width * 0.5f; for (int index = 0; index < _paths.Count - 1; index++) { v0 = _paths[index]; v1 = _paths[index + 1]; o = (new Vector3(v1.y, v0.x, 0.0f) - new Vector3(v0.y, v1.x, 0.0f)).normalized; DrawLine2D(v0, v1, o); DrawMark2D(v0, v1, o); } } } GL.End(); } GL.PopMatrix(); }