Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 100))
        {
            if (hit.transform.gameObject == gameObject)
            {
                if (Input.GetMouseButtonUp(0))
                {
                    //Tell the mesh that this is the selected vertex
                    meshScript.SetSelectedVert(gameObject);
                }
            }
        }
    }