本文整理汇总了C#中IScene.TryGetPublicCapability方法的典型用法代码示例。如果您正苦于以下问题:C# IScene.TryGetPublicCapability方法的具体用法?C# IScene.TryGetPublicCapability怎么用?C# IScene.TryGetPublicCapability使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScene
的用法示例。
在下文中一共展示了IScene.TryGetPublicCapability方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromScene
public static SceneInfo FromScene(IScene scene)
{
SceneInfo info = new SceneInfo
{
ID = scene.ID,
Name = scene.Name,
MinPosition = scene.MinPosition,
MaxPosition = scene.MaxPosition
};
scene.TryGetPublicCapability("public_region_seed_capability", out info.PublicSeedCapability);
return info;
}
示例2: SceneStartHandler
private void SceneStartHandler(IScene scene)
{
#region Scene Registration
Uri publicSeedCap;
if (scene.TryGetPublicCapability("public_region_seed_capability", out publicSeedCap))
scene.ExtraData["PublicSeedCapability"] = OSD.FromUri(publicSeedCap);
else
m_log.Warn("Registering scene " + scene.Name + " with the grid service without a public seed capability");
NameValueCollection requestArgs = new NameValueCollection
{
{ "RequestMethod", "AddScene" },
{ "SceneID", scene.ID.ToString() },
{ "Name", scene.Name },
{ "MinPosition", scene.MinPosition.ToString() },
{ "MaxPosition", scene.MaxPosition.ToString() },
{ "Address", m_httpServer.HttpAddress.AbsoluteUri },
{ "Enabled", "1" },
{ "ExtraData", OSDParser.SerializeJsonString(scene.ExtraData) }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
if (!response["Success"].AsBoolean())
m_log.Warn("Region registration for " + scene.Name + " failed: " + response["Message"].AsString());
#endregion Scene Registration
}