|
|
|
|
|
|
var configurationIndex = dropdown.value; |
|
|
|
|
|
|
|
// Check that the value makes sense
|
|
|
|
if (configurationIndex >= cameraSubsystem.GetConfigurationCount()) |
|
|
|
var configurations = cameraSubsystem.Configurations(); |
|
|
|
if (configurationIndex >= configurations.count) |
|
|
|
var configuration = cameraSubsystem.GetConfiguration(configurationIndex); |
|
|
|
var configuration = configurations[configurationIndex]; |
|
|
|
cameraSubsystem.SetConfiguration(configuration); |
|
|
|
cameraSubsystem.SetCurrentConfiguration(configuration); |
|
|
|
} |
|
|
|
|
|
|
|
void Awake() |
|
|
|
|
|
|
|
|
|
|
// No configurations available probably means this feature
|
|
|
|
// isn't supported by the current device.
|
|
|
|
if (cameraSubsystem.GetConfigurationCount() == 0) |
|
|
|
var configurations = cameraSubsystem.Configurations(); |
|
|
|
if (configurations.count == 0) |
|
|
|
return; |
|
|
|
|
|
|
|
// Here we demonstrate the two ways to enumerate the camera configurations.
|
|
|
|
|
|
|
// Here, we use a foreach to iterate over all the available configurations
|
|
|
|
m_ConfigurationNames.Clear(); |
|
|
|
foreach (var config in cameraSubsystem.Configurations()) |
|
|
|
foreach (var config in configurations) |
|
|
|
for (int i = 0; i < cameraSubsystem.GetConfigurationCount(); i++) |
|
|
|
for (int i = 0; i < configurations.count; i++) |
|
|
|
if (currentConfig == cameraSubsystem.GetConfiguration(i)) |
|
|
|
if (currentConfig == configurations[i]) |
|
|
|
m_Dropdown.value = i; |
|
|
|
} |
|
|
|
} |