コード例 #1
0
    void Start()
    {
        scriptEnabled = true;
        skinnedMeshCollider.Init();
        skinnedMeshCollider.BakeMeshData();

        vertexData = _Vertex.LoadData(filename, saveFolder);

        _Mesh.AutoWeld(mesh, weldDistance);
        _Vertex.InitRawMesh(mesh,
                            out totalVerts,
                            out totalTrianglePoints);
        mesh.MarkDynamic();

        totalTriangles         = vertexData.sortedTriangles.Length;
        totalTriangleNeighbors = vertexData.neighborTriangles.Length;

        // Compute Shader Initialization
        InitKernels();
        InitBuffers();
        InitVariables();

        // init SkinnedMeshRenderer for front face
        this.GetComponent <SkinnedMeshRenderer>().material          = frontMat;
        this.GetComponent <SkinnedMeshRenderer>().receiveShadows    = false;
        this.GetComponent <SkinnedMeshRenderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;

        // init SkinnedMeshRenderer for back face
        backSide = _Mesh.CreateBackSide(this.gameObject);
        backMesh = backSide.GetComponent <SkinnedMeshRenderer>().sharedMesh;
        backSide.GetComponent <SkinnedMeshRenderer>().material          = backMat;
        backSide.GetComponent <SkinnedMeshRenderer>().receiveShadows    = false;
        backSide.GetComponent <SkinnedMeshRenderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
    }
コード例 #2
0
    void Start()
    {
        scriptEnabled = true;
        skinnedMeshCollider.Init();
        skinnedMeshCollider.BakeMeshData();

        vertexData = _Vertex.LoadData(filename, saveFolder);

        _Mesh.AutoWeld(mesh, weldDistance);
        _Vertex.InitRawMesh(mesh,
                            out totalVerts,
                            out totalTrianglePoints);
        mesh.MarkDynamic();

        totalTriangles         = vertexData.sortedTriangles.Length;
        totalTriangleNeighbors = vertexData.neighborTriangles.Length;

        // Compute Shader Initialization
        InitKernels();
        InitBuffers();
        InitVariables();
        backSide = _Mesh.CreateBackSide(this.gameObject);
        backMesh = backSide.GetComponent <SkinnedMeshRenderer>().sharedMesh;
    }