Ejemplo n.º 1
0
    void HandleInput4()
    {
        Ray        inputRay = cam.ScreenPointToRay(Input.mousePosition);
        Vector3    dir      = cam.ScreenToWorldPoint(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(inputRay, out hit))
        {
            MeshDeformer deformer = hit.collider.GetComponent <MeshDeformer>();
            if (deformer)
            {
                Vector3 point = hit.point;

                point += hit.normal * forceOffset4;

                deformer.AddDeformingForce4(point, force4, dir);
            }
        }
    }