本文整理汇总了C#中scriptEvents类的典型用法代码示例。如果您正苦于以下问题:C# scriptEvents类的具体用法?C# scriptEvents怎么用?C# scriptEvents使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
scriptEvents类属于命名空间,在下文中一共展示了scriptEvents类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: aggregateScriptEvents
public void aggregateScriptEvents()
{
AggregateScriptEvents = 0;
// Aggregate script events
lock (m_scriptEvents)
{
foreach (scriptEvents s in m_scriptEvents.Values)
{
AggregateScriptEvents |= s;
}
}
uint objectflagupdate = 0;
if (
((AggregateScriptEvents & scriptEvents.touch) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_end) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_start) != 0)
)
{
objectflagupdate |= (uint) PrimFlags.Touch;
}
if ((AggregateScriptEvents & scriptEvents.money) != 0)
{
objectflagupdate |= (uint) PrimFlags.Money;
}
if (AllowedDrop)
{
objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
}
if (
((AggregateScriptEvents & scriptEvents.collision) != 0) ||
((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
(CollisionSound != UUID.Zero)
)
{
// subscribe to physics updates.
if (PhysActor != null)
{
PhysActor.OnCollisionUpdate += PhysicsCollision;
PhysActor.SubscribeEvents(1000);
}
}
else
{
if (PhysActor != null)
{
PhysActor.UnSubscribeEvents();
PhysActor.OnCollisionUpdate -= PhysicsCollision;
}
}
//if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
//{
// ParentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
//}
//else
//{
// ParentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
//}
LocalFlags = (PrimFlags)objectflagupdate;
if (ParentGroup != null && ParentGroup.RootPart == this)
{
ParentGroup.aggregateScriptEvents();
}
else
{
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
ScheduleFullUpdate();
}
}
开发者ID:justasabc,项目名称:opensim,代码行数:82,代码来源:SceneObjectPart.cs
示例2: SendLandCollisionEvent
private void SendLandCollisionEvent(SceneObjectGroup dest, scriptEvents ev, ScriptCollidingNotification notify)
{
if ((dest.RootPart.ScriptEvents & ev) != 0)
{
ColliderArgs LandCollidingMessage = new ColliderArgs();
List<DetectedObject> colliding = new List<DetectedObject>();
colliding.Add(CreateDetObjectForGround());
LandCollidingMessage.Colliders = colliding;
notify(dest.RootPart.LocalId, LandCollidingMessage);
}
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:13,代码来源:ScenePresence.cs
示例3: RemoveScriptEvents
public void RemoveScriptEvents(UUID scriptid)
{
lock (m_scriptEvents)
{
if (m_scriptEvents.ContainsKey(scriptid))
{
scriptEvents oldparts = scriptEvents.None;
oldparts = (scriptEvents) m_scriptEvents[scriptid];
// remove values from aggregated script events
AggregateScriptEvents &= ~oldparts;
m_scriptEvents.Remove(scriptid);
aggregateScriptEvents();
}
}
}
开发者ID:justasabc,项目名称:opensim,代码行数:16,代码来源:SceneObjectPart.cs
示例4: aggregateScriptEvents
public void aggregateScriptEvents()
{
AggregateScriptEvents = 0;
// Aggregate script events
lock (m_scriptEvents)
{
foreach (scriptEvents s in m_scriptEvents.Values)
{
AggregateScriptEvents |= s;
}
}
uint objectflagupdate = 0;
if (
((AggregateScriptEvents & scriptEvents.touch) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_end) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_start) != 0)
)
{
objectflagupdate |= (uint) PrimFlags.Touch;
}
if ((AggregateScriptEvents & scriptEvents.money) != 0)
{
objectflagupdate |= (uint) PrimFlags.Money;
}
if (AllowedDrop)
{
objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
}
// subscribe to physics updates.
if (PhysActor != null)
{
PhysActor.OnCollisionUpdate += PhysicsCollision;
PhysActor.SubscribeEvents(1000);
}
if (m_parentGroup == null)
{
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents() since m_parentGroup == null", Name, LocalId);
ScheduleUpdate(PrimUpdateFlags.FullUpdate);
return;
}
LocalFlags=(PrimFlags)objectflagupdate;
if (m_parentGroup != null && m_parentGroup.RootPart == this)
{
m_parentGroup.aggregateScriptEvents();
}
else
{
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
ScheduleUpdate(PrimUpdateFlags.PrimFlags);
}
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:62,代码来源:SceneObjectPart.cs
示例5: SendCollisionEvent
private void SendCollisionEvent(SceneObjectGroup dest, scriptEvents ev, List<uint> colliders, ScriptCollidingNotification notify)
{
ColliderArgs CollidingMessage;
if (colliders.Count > 0)
{
if ((dest.RootPart.ScriptEvents & ev) != 0)
{
CollidingMessage = CreateColliderArgs(dest.RootPart, colliders);
if (CollidingMessage.Colliders.Count > 0)
notify(dest.RootPart.LocalId, CollidingMessage);
}
}
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:15,代码来源:ScenePresence.cs
示例6: SendCollisionEvent
private void SendCollisionEvent(scriptEvents ev, List<uint> colliders, ScriptCollidingNotification notify)
{
bool sendToRoot = false;
ColliderArgs CollidingMessage;
if (colliders.Count > 0)
{
if ((ScriptEvents & ev) != 0)
{
CollidingMessage = CreateColliderArgs(this, colliders);
if (CollidingMessage.Colliders.Count > 0)
notify(LocalId, CollidingMessage);
if (PassCollisions)
sendToRoot = true;
}
else
{
if ((ParentGroup.RootPart.ScriptEvents & ev) != 0)
sendToRoot = true;
}
if (sendToRoot && ParentGroup.RootPart != this)
{
CollidingMessage = CreateColliderArgs(ParentGroup.RootPart, colliders);
if (CollidingMessage.Colliders.Count > 0)
notify(ParentGroup.RootPart.LocalId, CollidingMessage);
}
}
}
开发者ID:VirTecIO,项目名称:opensim,代码行数:30,代码来源:SceneObjectPart.cs
示例7: aggregateScriptEvents
public void aggregateScriptEvents()
{
if (ParentGroup == null || ParentGroup.RootPart == null)
return;
AggregateScriptEvents = 0;
// Aggregate script events
lock (m_scriptEvents)
{
foreach (scriptEvents s in m_scriptEvents.Values)
{
AggregateScriptEvents |= s;
}
}
uint objectflagupdate = 0;
if (
((AggregateScriptEvents & scriptEvents.touch) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_end) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_start) != 0)
)
{
objectflagupdate |= (uint) PrimFlags.Touch;
}
if ((AggregateScriptEvents & scriptEvents.money) != 0)
{
objectflagupdate |= (uint) PrimFlags.Money;
}
if (AllowedDrop)
{
objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
}
SubscribeForCollisionEvents();
//if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
//{
// ParentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
//}
//else
//{
// ParentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
//}
LocalFlags = (PrimFlags)objectflagupdate;
if (ParentGroup != null && ParentGroup.RootPart == this)
{
ParentGroup.aggregateScriptEvents();
}
else
{
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
ScheduleFullUpdate();
}
}
开发者ID:VirTecIO,项目名称:opensim,代码行数:61,代码来源:SceneObjectPart.cs
示例8: aggregateScriptEvents
public void aggregateScriptEvents()
{
AggregateScriptEvents = 0;
// Aggregate script events
lock (m_scriptEvents)
{
foreach (scriptEvents s in m_scriptEvents.Values)
{
AggregateScriptEvents |= s;
}
}
uint objectflagupdate = 0;
if (
((AggregateScriptEvents & scriptEvents.touch) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_end) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_start) != 0)
)
{
objectflagupdate |= (uint) PrimFlags.Touch;
}
if ((AggregateScriptEvents & scriptEvents.money) != 0)
{
objectflagupdate |= (uint) PrimFlags.Money;
}
if (AllowedDrop)
{
objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
}
// subscribe to physics updates.
//We subscribe by default now... so 'shouldn't' need this
if ((((AggregateScriptEvents & scriptEvents.collision) != 0) ||
((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
((AggregateScriptEvents & scriptEvents.land_collision_start) != 0)
) && PhysActor != null)
{
if (!m_hasSubscribedToCollisionEvent)
{
m_hasSubscribedToCollisionEvent = true;
PhysActor.OnCollisionUpdate += PhysicsCollision;
PhysActor.SubscribeEvents(1000);
}
}
else if (PhysActor != null)
{
if (m_hasSubscribedToCollisionEvent)
{
m_hasSubscribedToCollisionEvent = false;
PhysActor.OnCollisionUpdate -= PhysicsCollision;
}
}
if (m_parentGroup == null)
{
// MainConsole.Instance.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents() since m_parentGroup == null", Name, LocalId);
ScheduleUpdate(PrimUpdateFlags.FullUpdate);
return;
}
LocalFlags = (PrimFlags) objectflagupdate;
if (m_parentGroup != null && m_parentGroup.RootPart == this)
{
m_parentGroup.aggregateScriptEvents();
}
else
{
// MainConsole.Instance.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
ScheduleUpdate(PrimUpdateFlags.PrimFlags);
}
}
开发者ID:JAllard,项目名称:Aurora-Sim,代码行数:81,代码来源:SceneObjectPart.cs
示例9: SendLandCollisionEvent
private void SendLandCollisionEvent(scriptEvents ev, ScriptCollidingNotification notify)
{
bool sendToRoot = true;
ColliderArgs LandCollidingMessage = new ColliderArgs();
List<DetectedObject> colliding = new List<DetectedObject>();
colliding.Add(CreateDetObjectForGround());
LandCollidingMessage.Colliders = colliding;
if (Inventory.ContainsScripts())
{
if (!PassCollisions)
sendToRoot = false;
}
if ((ScriptEvents & ev) != 0)
notify(LocalId, LandCollidingMessage);
if ((ParentGroup.RootPart.ScriptEvents & ev) != 0 && sendToRoot)
{
notify(ParentGroup.RootPart.LocalId, LandCollidingMessage);
}
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:23,代码来源:SceneObjectPart.cs
示例10: RemoveScriptEvents
public void RemoveScriptEvents(UUID scriptid)
{
scriptEvents oldparts;
if (m_scriptEvents.Remove(scriptid, out oldparts))
{
// remove values from aggregated script events
AggregateScriptEvents &= ~oldparts;
aggregateScriptEvents();
}
}
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:10,代码来源:SceneObjectPart.cs
示例11: aggregateScriptEvents
public void aggregateScriptEvents()
{
AggregateScriptEvents = 0;
// Aggregate script events
lock (m_scriptEvents)
{
foreach (scriptEvents s in m_scriptEvents.Values)
{
AggregateScriptEvents |= s;
}
}
uint objectflagupdate = 0;
if (
((AggregateScriptEvents & scriptEvents.touch) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_end) != 0) ||
((AggregateScriptEvents & scriptEvents.touch_start) != 0)
)
{
objectflagupdate |= (uint) PrimFlags.Touch;
}
if ((AggregateScriptEvents & scriptEvents.money) != 0)
{
objectflagupdate |= (uint) PrimFlags.Money;
}
if (AllowedDrop)
{
objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
}
if (
((AggregateScriptEvents & scriptEvents.collision) != 0) ||
((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
(CollisionSound != UUID.Zero)
)
{
// subscribe to physics updates.
if (PhysActor != null)
{
PhysActor.OnCollisionUpdate += PhysicsCollision;
PhysActor.SubscribeEvents(1000);
}
}
else
{
if (PhysActor != null)
{
PhysActor.UnSubscribeEvents();
PhysActor.OnCollisionUpdate -= PhysicsCollision;
}
}
if (m_parentGroup == null)
{
ScheduleFullUpdate();
return;
}
if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
{
m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
}
else
{
m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
}
LocalFlags=(PrimFlags)objectflagupdate;
if (m_parentGroup != null && m_parentGroup.RootPart == this)
m_parentGroup.aggregateScriptEvents();
else
ScheduleFullUpdate();
}
开发者ID:Ideia-Boa,项目名称:opensim,代码行数:80,代码来源:SceneObjectPart.cs
注:本文中的scriptEvents类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论