本文整理汇总了C#中IScene.ForEachEntity方法的典型用法代码示例。如果您正苦于以下问题:C# IScene.ForEachEntity方法的具体用法?C# IScene.ForEachEntity怎么用?C# IScene.ForEachEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScene
的用法示例。
在下文中一共展示了IScene.ForEachEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start(IScene scene)
{
m_scene = scene;
m_dataStore = m_scene.Simian.GetAppModule<IDataStore>();
// Set the prims per square meter value
m_primsPerSquareMeter = DEFAULT_PRIMS_PER_SQM;
IConfig config = scene.Config.Configs["LindenRegion"];
if (config != null)
{
// Parse the floating point value as a string and convert manually to avoid
// localization issues. This hack should be removed when we fix our build of Nini
// to always parse with EnUsCulture
string primsPerSquareMeterStr = config.GetString("PrimsPerSquareMeter", DEFAULT_PRIMS_PER_SQM.ToString());
if (!Single.TryParse(primsPerSquareMeterStr, out m_primsPerSquareMeter))
m_primsPerSquareMeter = DEFAULT_PRIMS_PER_SQM;
}
m_parcels = new DoubleDictionarySlim<UUID, int, SceneParcel>();
m_parcelOverlay = new int[64 * 64];
// Load serialized parcel information if we have any
Deserialize();
if (m_currentParcelID == 0)
{
// Create a default parcel if nothing was serialized
CreateDefaultParcel();
}
// Put all of the initial scene entities in parcels
m_scene.ForEachEntity(AddEntityToParcel);
m_scene.OnEntitySignificantMovement += EntitySignificantMovementHandler;
}
示例2: CreateAllPrims
private void CreateAllPrims(IScene scene, WarpRenderer renderer, IPrimMesher primMesher)
{
if (primMesher == null)
return;
scene.ForEachEntity(
delegate(ISceneEntity entity)
{
if (entity is LLPrimitive)
CreatePrim(renderer, (LLPrimitive)entity, primMesher);
}
);
}