Topic: Generating a Tour at runtime
I am working on trying to generate a Tour dynamically at run time. The system I have built out works great if I generate the Tour items in editor, but there seems to be a referencing issue otherwise. Couple problems I am having, and have avoided a bit is making sure the uPano Tour Object, and at least one Tour Item is appended into it, otherwise there is several null references. I am generating the panos with this following code, and the cameraType/existingCamera do not get properly set in the scene graph, and default to "createNew".
void MyPanoGenerator(Tour tour){
TourItem item = TourItem.Create(tour);
Pano pano = item.gameObject.GetComponent<Pano>();
pano.cameraType = Pano.CameraType.existing;
pano.existingCamera = Camera.main;
SphericalPanoRenderer spr = item.gameObject.GetComponent<SphericalPanoRenderer>();
spr.radius = 100;
//....etc
}
This does work fully IF this method is run in editor (before hitting the play button). Is there a method I need to use to update the pano with the new context, or another construction method I should use?
Thank you for you help