示例#1
0
    // Update is called once per frame
    private void Update()
    {
        Ray        ray = cam.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0));
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 2))
        {
            OvenType ovenType = hit.collider.GetComponent <OvenType>();

            if (ovenType != null)
            {
                print("You can cook shit here!!");
            }
        }
    }
示例#2
0
 public Oven(OvenType oventype)
 {
     this.ovenType = oventype;
 }