Example #1
0
    /*
     * public string EditInput(string input)
     * {
     *
     * }
     */

    public bool ObjectClick()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit))
            {
                if (hit.transform != null)
                {
                    if (hit.transform.GetComponent <VirtualFunction>() != null)
                    {
                        if (vfunction != null)
                        {
                            vfunction.DettachedToEditor();
                        }

                        vfunction = hit.transform.GetComponent <VirtualFunction>();
                        vfunction.AttachedToEditor();
                        os = vfunction.vos;
                    }

                    OpenEditor();
                    return(true);
                }
            }
        }

        return(false);
    }