Ejemplo n.º 1
0
    private void Update()
    {
        RaycastHit raycastHit;

        Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out raycastHit);

        if (Input.GetMouseButtonDown(0) && basicBuidingAssign != null)
        {
            if (raycastHit.point != Vector3.zero)
            {
                BasicBuiding obj = Instantiate(basicBuidingAssign, raycastHit.point, basicBuidingAssign.transform.rotation);
            }
        }
        else if (Input.GetMouseButtonDown(1))
        {
            basicBuidingAssign = null;
        }
    }
 public void AddBuiding()
 {
     BasicBuiding basicBuiding = Instantiate(basicBuidingPrefab);
 }