Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (!Input.GetMouseButtonDown(0))
        {
            return;
        }

        Ray rayFromCamera = _targetCamera.ScreenPointToRay(Input.mousePosition);

        MeshFilter mf;
        float      dist;

        if (!MeshTester.hitObject(_meshFilters, rayFromCamera, out mf, out dist))
        {
            //Debug.Log("Not found");
            return;
        }

        Debug.Log(string.Format("Hit on {0}", mf.gameObject.name));
        StartCoroutine(ChangeColorForWhile(mf.gameObject.renderer, 1.0f));
    }
 private void OnEnable()
 {
     // Setup script and properties
     meshTester = (MeshTester)target;
 }