Example #1
0
        public void ClearAndSetup(string name = "New Mesh", Mesh recycleMesh = null)
        {
            if (recycleMesh == null)
            {
                if (!Application.isPlaying)
                {
                    mesh = new Mesh();
                }
                else
                {
                    mesh = MeshPool.Get();
                }
            }
            else
            {
                mesh = recycleMesh;
            }

            //mesh = new Mesh();
            mesh.name = name;

            vertices = ListPool <Vector3> .Get();

            triangles = ListPool <int> .Get();

            colors = ListPool <Color> .Get();

            uvs = ListPool <Vector2> .Get();

            uvs2 = ListPool <Vector2> .Get();

            readyToBuild = true;
        }