// 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!!"); } } }
public Oven(OvenType oventype) { this.ovenType = oventype; }