Example #1
0
    public void Update(TrainSetionManager manager)
    {
        //  Debug.Log("Vertex  begin  ======");



        for (int i = 0; i < maxCount; i++)
        {
            TrailSection section = manager.GetMembers(i);

            meshVertices[i * 2] = section.vertex[0];

            meshVertices[i * 2 + 1] = section.vertex[1];


            //  Debug.Log("section.vertex[0]==" + section.vertex[0]);

            //   Debug.Log("section.vertex[1]==" + section.vertex[1]);

            meshColor[i * 2] = section.colors[0];

            meshColor[i * 2 + 1] = section.colors[1];



            meshUV[i * 2] = section.uv[0];

            meshUV[i * 2 + 1] = section.uv[1];
        }


        FreshMesh();
    }
Example #2
0
    // Use this for initialization
    void Awake()
    {
        myMesh = transform.GetComponent <MeshFilter>().mesh;


        myMesh.Clear();


        //myMesh.vertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 1, 0), new Vector3(1, 1, 0) };
        //myMesh.uv = new Vector2[] { new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1) };
        //myMesh.triangles = new int[] { 0, 1, 2 };



        trainSetion = new TrainSetionManager(cellCount, transform, startColor, endColor);


        //trainSetion.startColor = startColor;

        //trainSetion.endColor = endColor;

        trainSetion.lastTimer = lastTimer;



        trainSetion.height = height;


        trainSetion.sqrMinDistance = middleTime;


        meshTrail = new MeshManager(cellCount, myMesh);


        // meshTrail.Update(trainSetion);
    }