本文整理匯總了C#中WinterLeaf.Engine.Classes.View.Creators.ObjectCreator.sortfk方法的典型用法代碼示例。如果您正苦於以下問題:C# ObjectCreator.sortfk方法的具體用法?C# ObjectCreator.sortfk怎麽用?C# ObjectCreator.sortfk使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WinterLeaf.Engine.Classes.View.Creators.ObjectCreator
的用法示例。
在下文中一共展示了ObjectCreator.sortfk方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: sfxAutodetect
public static bool sfxAutodetect()
{
// Get all the available devices.
string devices = omni.Util.sfxGetAvailableDevices();
// Collect and sort the devices by preferentiality.
int count = omni.Util.getRecordCount(devices);
ArrayObject deviceTrySequence = new ObjectCreator("ArrayObject").Create().AsString();
for (int i = 0; i < count; i++)
{
string info = omni.Util.getRecord(devices, i);
string provider = omni.Util.getField(info, 0);
deviceTrySequence.push_back(provider, info);
}
deviceTrySequence.sortfk("sfxCompareProvider");
// Try the devices in order.
count = deviceTrySequence.count();
for (int i = 0; i < count; i++)
{
string provider = deviceTrySequence.getKey(i);
string info = deviceTrySequence.getValue(i);
omni.sGlobal["$pref::SFX::provider"] = provider;
omni.sGlobal["$pref::SFX::device"] = omni.Util.getField(info, 1);
omni.sGlobal["$pref::SFX::useHardware"] = omni.Util.getField(info, 2);
// By default we've decided to avoid hardware devices as
// they are buggy and prone to problems.
omni.bGlobal["$pref::SFX::useHardware"] = false;
if (!sfxInit())
continue;
omni.bGlobal["$pref::SFX::autoDetect"] = false;
deviceTrySequence.delete();
return true;
}
// Found no suitable device.
omni.console.error("sfxAutodetect - Could not initialize a valid SFX device.");
omni.sGlobal["$pref::SFX::provider"] = "";
omni.sGlobal["$pref::SFX::device"] = "";
omni.sGlobal["$pref::SFX::useHardware"] = "";
deviceTrySequence.delete();
return false;
}