Ejemplo n.º 1
0
    public void Update()
    {
        m_MeshModJob = new MeshModJob()
        {
            vertices = m_Vertices,
            normals  = m_Normals,
            sinTime  = Mathf.Sin(Time.time),
            cosTime  = Mathf.Cos(Time.time),
            strength = m_Strength / 5f
        };

        m_JobHandle = m_MeshModJob.Schedule(m_Vertices.Length, 64);
    }
Ejemplo n.º 2
0
    public void Update()
    {
        meshModJob = new MeshModJob()
        {
            vertices   = vertices,
            velocities = velocities,
            mpv0       = modPoints[0].Values,
            mpv1       = modPoints[1].Values
        };

        jobHandle = meshModJob.Schedule(vertices.Length, 64);
        jobHandle.Complete();
        meshModJob.vertices.CopyTo(modVertices);
        meshModJob.velocities.CopyTo(modVelocities);
        mesh.ApplyModified(modVertices, modVelocities);
    }