コード例 #1
0
    public void UpdateMeshComponent()
    {
        Mesh thisChunkGOMesh = GetComponent <MeshFilter>().sharedMesh = loadedChunk.m_meshData.BuildMeshComponent();
        Mesh surfaceGOMesh   = surfaceGO.GetComponent <MeshFilter>().sharedMesh = loadedChunk.m_surfaceMeshData.BuildMeshComponent();

        //Setting Colliders
        GetComponent <MeshCollider>().sharedMesh           = thisChunkGOMesh;
        surfaceGO.GetComponent <MeshCollider>().sharedMesh = surfaceGOMesh;
        //Setting Uvs
        UVMapper.BoxUV(surfaceGOMesh, surfaceGO.transform);
        UVMapper.BoxUV(thisChunkGOMesh, transform);
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        if (sourceMesh == null)
        {
            return;
        }

        // Use a copy of the mesh!
        Mesh tempMesh = Instantiate(sourceMesh);

        UVMapper.BoxUV(tempMesh, transform);

        GetComponent <MeshFilter>().sharedMesh = tempMesh;
    }