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


C# IScenePresence.ClearAttachments方法代码示例

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


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

示例1: DeleteAttachmentsFromScene

        public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent)
        {
            if (!Enabled)
                return;

            if (DebugLevel > 0)
                m_log.DebugFormat(
                    "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}",
                    m_scene.RegionInfo.RegionName, sp.Name, silent);            

            foreach (SceneObjectGroup sop in sp.GetAttachments())
            {
                sop.Scene.DeleteSceneObject(sop, silent);
            }

            sp.ClearAttachments();
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:17,代码来源:AttachmentsModule.cs

示例2: DeRezAttachments

        public void DeRezAttachments(IScenePresence sp)
        {
            if (!Enabled)
                return;

            if (DebugLevel > 0)
                m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name);

            List<SceneObjectGroup> attachments = sp.GetAttachments();

            if (attachments.Count <= 0)
                return;

            Dictionary<SceneObjectGroup, string> scriptStates = new Dictionary<SceneObjectGroup, string>();

            foreach (SceneObjectGroup so in attachments)
            {
                // Scripts MUST be snapshotted before the object is
                // removed from the scene because doing otherwise will
                // clobber the run flag
                // This must be done outside the sp.AttachmentSyncLock so that there is no risk of a deadlock from
                // scripts performing attachment operations at the same time.  Getting object states stops the scripts.
                scriptStates[so] = PrepareScriptInstanceForSave(so, false);
            }

            lock (sp.AttachmentsSyncLock)
            {
                foreach (SceneObjectGroup so in attachments)
                    UpdateDetachedObject(sp, so, scriptStates[so]);
    
                sp.ClearAttachments();
            }
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:33,代码来源:AttachmentsModule.cs

示例3: CopyAttachments

        public void CopyAttachments(AgentData ad, IScenePresence sp)
        {
            if (ad.AttachmentObjects != null && ad.AttachmentObjects.Count > 0)
            {
                lock (sp.AttachmentsSyncLock)
                    sp.ClearAttachments();

                int i = 0;
                foreach (ISceneObject so in ad.AttachmentObjects)
                {
                    ((SceneObjectGroup)so).LocalId = 0;
                    ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();
                    so.SetState(ad.AttachmentObjectStates[i++], m_scene);
                    m_scene.IncomingCreateObject(Vector3.Zero, so);
                }
            }
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:17,代码来源:AttachmentsModule.cs

示例4: DeRezAttachments

        public void DeRezAttachments(IScenePresence sp)
        {
            if (!Enabled)
                return;

//            m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name);

            lock (sp.AttachmentsSyncLock)
            {
                foreach (SceneObjectGroup so in sp.GetAttachments())
                {
                    UpdateDetachedObject(sp, so);
                }
    
                sp.ClearAttachments();
            }
        }
开发者ID:p07r0457,项目名称:opensim,代码行数:17,代码来源:AttachmentsModule.cs

示例5: CopyAttachments

        public void CopyAttachments(AgentData ad, IScenePresence sp)
        {
//            m_log.DebugFormat("[ATTACHMENTS MODULE]: Copying attachment data into {0} in {1}", sp.Name, m_scene.Name);

            if (ad.AttachmentObjects != null && ad.AttachmentObjects.Count > 0)
            {
                lock (sp.AttachmentsSyncLock)
                    sp.ClearAttachments();

                int i = 0;
                foreach (ISceneObject so in ad.AttachmentObjects)
                {
                    ((SceneObjectGroup)so).LocalId = 0;
                    ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();

//                    m_log.DebugFormat(
//                        "[ATTACHMENTS MODULE]: Copying script state with {0} bytes for object {1} for {2} in {3}", 
//                        ad.AttachmentObjectStates[i].Length, so.Name, sp.Name, m_scene.Name);

                    so.SetState(ad.AttachmentObjectStates[i++], m_scene);
                    m_scene.IncomingCreateObject(Vector3.Zero, so);
                }
            }
        }
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:24,代码来源:AttachmentsModule.cs

示例6: DeRezAttachments

        public void DeRezAttachments(IScenePresence sp, bool saveChanged, bool saveAllScripted)
        {
            if (!Enabled)
                return;

//            m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name);

            lock (sp.AttachmentsSyncLock)
            {
                foreach (SceneObjectGroup grp in sp.GetAttachments())
                {
                    grp.Scene.DeleteSceneObject(grp, false);
    
                    if (saveChanged || saveAllScripted)
                    {
                        grp.IsAttachment = false;
                        grp.AbsolutePosition = grp.RootPart.AttachedPos;
                        UpdateKnownItem(sp, grp, saveAllScripted);
                    }
                }
    
                sp.ClearAttachments();
            }
        }
开发者ID:JAllard,项目名称:opensim,代码行数:24,代码来源:AttachmentsModule.cs


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