当前位置: 首页>>代码示例>>C#>>正文


C# ScriptData.ResetEvents方法代码示例

本文整理汇总了C#中Aurora.ScriptEngine.AuroraDotNetEngine.ScriptData.ResetEvents方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptData.ResetEvents方法的具体用法?C# ScriptData.ResetEvents怎么用?C# ScriptData.ResetEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aurora.ScriptEngine.AuroraDotNetEngine.ScriptData的用法示例。


在下文中一共展示了ScriptData.ResetEvents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckIfEventShouldFire


//.........这里部分代码省略.........
                    return false; //If the script doesn't contain the state, don't even bother queueing it

                //Make sure we can execute events at position
                if (!m_scriptEngine.PipeEventsForScript (ID.Part))
                    return false;

                if (eventType == scriptEvents.timer)
                {
                    if (ID.TimerQueued)
                        return false;
                    ID.TimerQueued = true;
                }
                else if (eventType == scriptEvents.control)
                {
                    int held = ((LSL_Types.LSLInteger)param[1]).value;
                    // int changed = ((LSL_Types.LSLInteger)data.Params[2]).value;

                    // If the last message was a 0 (nothing held)
                    // and this one is also nothing held, drop it
                    //
                    if (ID.LastControlLevel == held && held == 0)
                        return true;

                    // If there is one or more queued, then queue
                    // only changed ones, else queue unconditionally
                    //
                    if (ID.ControlEventsInQueue > 0)
                    {
                        if (ID.LastControlLevel == held)
                            return false;
                    }
                }
                else if (eventType == scriptEvents.collision)
                {
                    if (ID.CollisionInQueue || ID.RemoveCollisionEvents)
                        return false;

                    ID.CollisionInQueue = true;
                }
                else if (eventType == scriptEvents.moving_start)
                {
                    if (ID.MovingInQueue) //Block all other moving_starts until moving_end is called
                        return false;
                    ID.MovingInQueue = true;
                }
                else if (eventType == scriptEvents.moving_end)
                {
                    if (!ID.MovingInQueue) //If we get a moving_end after we have sent one event, don't fire another
                        return false;
                }
                else if (eventType == scriptEvents.collision_end)
                {
                    if (ID.RemoveCollisionEvents)
                        return false;
                }
                else if (eventType == scriptEvents.touch)
                {
                    if (ID.TouchInQueue || ID.RemoveTouchEvents)
                        return false;

                    ID.TouchInQueue = true;
                }
                else if (eventType == scriptEvents.touch_end)
                {
                    if (ID.RemoveTouchEvents)
                        return false;
                }
                else if (eventType == scriptEvents.land_collision)
                {
                    if (ID.LandCollisionInQueue || ID.RemoveLandCollisionEvents)
                        return false;

                    ID.LandCollisionInQueue = true;
                }
                else if (eventType == scriptEvents.land_collision_end)
                {
                    if (ID.RemoveLandCollisionEvents)
                        return false;
                }
                else if (eventType == scriptEvents.changed)
                {
                    Changed changed;
                    if (param[0] is Changed)
                    {
                        changed = (Changed)param[0];
                    }
                    else
                    {
                        changed = (Changed)(((LSL_Types.LSLInteger)param[0]).value);
                    }
                    if (ID.ChangedInQueue.Contains (changed))
                        return false;
                    ID.ChangedInQueue.Add (changed);
                }

                if (FunctionName == "state_entry")
                    ID.ResetEvents ();
            }
            return true;
        }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:101,代码来源:EventManager.cs


注:本文中的Aurora.ScriptEngine.AuroraDotNetEngine.ScriptData.ResetEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。