private void SetMesh() { GameObject currentObject = Selection.activeGameObject; if (currentObject && currentObject.GetComponent <MeshFilter>()) { m_meshFilter = currentObject.GetComponent <MeshFilter>(); string name = m_meshFilter.sharedMesh.name; Mesh mesh; if (AssetDatabase.Contains(m_meshFilter.sharedMesh)) { mesh = Mesh.Instantiate(m_meshFilter.sharedMesh) as Mesh; mesh.name = ((m_meshFilter.sharedMesh.name.Length >= 3 && (m_meshFilter.sharedMesh.name.Substring(0, 3).CompareTo("mp_") == 0)) ? "" : "mp_") + name; } else { mesh = m_meshFilter.sharedMesh; } m_currentMesh = mesh; m_vertexColors = new VertexColors(m_currentMesh); } else { ClearMem(); } }
public VertexColor(VertexColors vertexColors) { this.vertexColors = vertexColors; current = vertexColors.realVerts.GetEnumerator(); }
private void ClearMem() { m_vertexColors = null; m_meshFilter = null; m_currentMesh = null; }