Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(1))
        {
            Debug.Log("mouse");

            Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit))
            {
                Debug.Log(hit.transform.name);
                Debug.Log("col");


                Build_Menue_Controller.FadeIn(hit.transform.position);
                Instantiate(TestBuilding, hit.transform.position, Quaternion.identity);
            }
        }
    }
Ejemplo n.º 2
0
    void MouseClick()
    {
        Debug.Log("Did sth");

        RaycastHit hit;
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        //if (Physics.Raycast(ray,out hit))
        //{
        //    Debug.Log("Did even more");
        //    Instantiate(particle, hit.point, hit.transform.rotation);
        //}

        if (Physics.Raycast(ray, out hit))
        {
            V3mousePosition   = Input.mousePosition;
            V3mousePosition.z = 10;
            buildMenueController.FadeIn(Camera.main.ScreenToWorldPoint(V3mousePosition));
            //Debug.Log("The hitpoint:" + hit.point);
        }

        Debug.Log(hit.collider.gameObject.name);
    }