浏览代码

Update sample after some API changes

/1.5-preview
Tim Mowrer 6 年前
当前提交
cfa2b151
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 16
      Assets/Scripts/CameraConfigController.cs

16
Assets/Scripts/CameraConfigController.cs


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;
}
}
正在加载...
取消
保存