本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectGroup.SetGeneration方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectGroup.SetGeneration方法的具体用法?C# SceneObjectGroup.SetGeneration怎么用?C# SceneObjectGroup.SetGeneration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.SceneObjectGroup
的用法示例。
在下文中一共展示了SceneObjectGroup.SetGeneration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RezPrim
public virtual SceneObjectGroup RezPrim(SceneObjectPart sourcePart, SceneObjectPart newPart, int param, out string reason)
{
// Rez object
Vector3 pos = newPart.AbsolutePosition;
SceneObjectGroup group = new SceneObjectGroup(newPart);
bool isTemp = (group.RootPart.GetEffectiveObjectFlags() & PrimFlags.TemporaryOnRez) != 0;
ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y);
if (parcel == null)
{
reason = "land";
return null;
}
// Pass 0 for landImpact here so that it can be tested separately.
if (!Permissions.CanRezObject(0, newPart.OwnerID, sourcePart.UUID, pos, isTemp))
{
reason = "permission";
return null;
}
if (!CheckLandImpact(parcel, group.LandImpact, out reason))
{
return null;
}
// Check for grey goo fence
if (!CheckGreyGoo(sourcePart, group))
{
reason = "fence";
return null;
}
// Allowing the rez... update the last rez time and the new group fields
sourcePart.StampLastRez();
group.CurrentParcel = parcel; // initialize _currentParcel (and auto-return)
group.SetGeneration(group.RootPart.Generation); // now update the rest of the parts
group.ResetIDs();
//set the group's group before setting the object's position.
//this will make sure that the group id is correct during the script
//engine's group check
group.SetGroup(sourcePart.ParentGroup.RootPart.GroupID, null);
AddNewSceneObject(group, !isTemp);
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
rootPart.TrimPermissions();
if (group.RootPart.IsPrim)
{
group.ClearPartAttachmentData();
}
group.CreateScriptInstances(param, ScriptStartFlags.PostOnRez, DefaultScriptEngine, (int)ScriptStateSource.PrimData, null);
rootPart.ScheduleFullUpdate(PrimUpdateFlags.ForcedFullUpdate);
reason = "success";
return rootPart.ParentGroup;
}