 -- Setup
entRoot=Game.GetRootEntity();

-- View the scene from a given camera for a given period of time
function ViewFromStaticCamera(camName, duration)
    currentCamera = Entity.FindName(entRoot, camName);
    Game.SetWindowEntity(0, currentCamera);
    Script.WaitSec(duration);
    end

-- Set the scene to the given waypoint camera and reset the camera to
-- the given waypoint for the given duration
function ViewFromWaypointCamera(camName, waypointName, duration)
    currentCamera = Entity.FindName(entRoot, camName);
    Game.SetWindowEntity(0, currentCamera);
    Game.CameraSetWaypoint(currentCamera, waypointName);
    Script.WaitSec(duration);
    end


-- camera shots
ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS22", 3.2);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybyFast", "CW0", 6.5);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS11", 8.);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybyFast", "CW9", 5.75);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS16", 5);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybyFast", "CW14", 4);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS2", 4.63);
Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybyFast", "CW18", 3.86);
Game.CameraPause(currentCamera);
--ViewFromWaypointCamera("CameraPreRaceFlybySlow", "CS16", 5.);
--Game.CameraPause(currentCamera);
ViewFromWaypointCamera("CameraPreRaceFlybyFast", "CW22", 5.5);

ViewFromWaypointCamera("CameraPreRaceToStart", "CTS0", 10.000);

Game.SetIntroDone(1);
