Though I'm not that familiar with the HoloKit API, I'd assume that your camera is aligned with where the player is looking. In that case, you can send a raycast out from the camera and then check if it hits the cube. If the raycast does, then you can change the scene, like so:
public void Update() {
RaycastHit hit = null;
if (Physics.Raycast(transform.position, transform.forward, hit) && hit.transform.gameObject.name == "cubeName") {
SceneManager.LoadScene("nextScene");
}
}
Of course, you might not want the cube to load the scene the instant they lay eyes upon it. In that case, you could keep track of how long they look at it, and then change scenes after looking at it for a certain amount:
public float lookTime;
public void Update() {
RaycastHit hit = null;
if (Physics.Raycast(transform.position, transform.forward, hit) && hit.transform.gameObject.name == "cubeName") {
lookTime += Time.deltaTime;
}
else {
lookTime = 0;
}
if(lookTime > 1000) {
SceneManager.LoadScene("nextScene");
}
}
This script, when attached to your camera, will raycast from the camera and check if what it hits is named cubeName
. Then, it will add the current amount of time change to lookTime
. When lookTime
reaches 1000 milliseconds, or one second, it will load the scene nextScene
.