void End()
            {
                m_Mesh.Clear();

                if (BuiltinMaterials.geometryShadersSupported)
                {
                    for (int i = 0, c = m_Points.Count; i < c; ++i)
                    {
                        m_Indices.Add(i);
                    }

                    m_Mesh.SetVertices(m_Points);

#if UNITY_2019_3_OR_NEWER
                    m_Mesh.SetIndices(m_Indices, MeshTopology.Points, 0, false);
#else
                    m_Mesh.SetIndices(m_Indices.ToArray(), MeshTopology.Points, 0, false);
#endif
                }
                else
                {
                    MeshHandles.CreatePointBillboardMesh(m_Points, m_Mesh);
                }

                Graphics.DrawMeshNow(m_Mesh, m_Matrix, 0);
            }
示例#2
0
            void End()
            {
                m_Mesh.Clear();

                if (BuiltinMaterials.geometryShadersSupported)
                {
                    for (int i = 0, c = m_Points.Count; i < c; ++i)
                    {
                        m_Indices.Add(i);
                    }

                    m_Mesh.SetVertices(m_Points);

                    // NoAllocHelpers is internal API, and there is no SetIndices overload that accepts a list like
                    // SetVertices or SetUVs.
//#if UNITY_2019_1_OR_NEWER
//                    m_Mesh.SetIndices(NoAllocHelpers.ExtractArrayFromListT(m_Indices), MeshTopology.Points, 0, false);
//#else
                    m_Mesh.SetIndices(m_Indices.ToArray(), MeshTopology.Points, 0, false);
                }
                else
                {
                    MeshHandles.CreatePointBillboardMesh(m_Points, m_Mesh);
                }

                Graphics.DrawMeshNow(m_Mesh, m_Matrix, 0);
            }