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


C# ISceneChildEntity类代码示例

本文整理汇总了C#中ISceneChildEntity的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity类的具体用法?C# ISceneChildEntity怎么用?C# ISceneChildEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: DeserializeComponents

        /// <summary>
        ///     Take the serialized string and set up the Components for this object
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="serialized"></param>
        public void DeserializeComponents(ISceneChildEntity obj, string serialized)
        {
            //Pull the OSDMap out for components
            OSDMap map;
            try
            {
                if (serialized == "")
                    map = new OSDMap();
                else
                    map = (OSDMap) OSDParser.DeserializeJson(serialized);
            }
            catch
            {
                //Bad JSON? Just return
                return;
            }

            //Now check against the list of components we have loaded
            foreach (KeyValuePair<string, OSD> kvp in map)
            {
                PropertyInfo property = obj.GetType().GetProperty(kvp.Key);
                if (property != null)
                {
                    property.SetValue(obj, Util.OSDToObject(kvp.Value, property.PropertyType), null);
                }
            }
            map.Clear();
            map = null;
        }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:34,代码来源:ComponentManager.cs

示例2: GetMediaEntry

        public MediaEntry GetMediaEntry(ISceneChildEntity part, int face)
        {
            MediaEntry me = null;

            CheckFaceParam(part, face);

            List<MediaEntry> media = part.Shape.Media;

            if (null == media)
            {
                me = null;
            }
            else
            {
                lock (media)
                    me = media[face];

                // TODO: Really need a proper copy constructor down in libopenmetaverse
                if (me != null)
                    me = MediaEntry.FromOSD(me.GetOSD());
            }

//            MainConsole.Instance.DebugFormat("[MOAP]: GetMediaEntry for {0} face {1} found {2}", part.Name, face, me);

            return me;
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:26,代码来源:MoapModule.cs

示例3: Initialize

 public void Initialize (IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
 {
     m_itemID = itemID;
     m_ScriptEngine = ScriptEngine;
     m_host = host;
     ScriptProtection = module;
 }
开发者ID:RevolutionSmythe,项目名称:Aurora-Sim,代码行数:7,代码来源:Bot_API.cs

示例4: Initialize

 public void Initialize (IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
 {
     m_itemID = itemID;
     m_ScriptEngine = ScriptEngine;
     m_host = host;
     ScriptProtection = module;
     AssetConnector = Aurora.DataManager.DataManager.RequestPlugin<IAssetConnector>();
 }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:8,代码来源:AA_API.cs

示例5: DeleteFrom

 public void DeleteFrom(ISceneChildEntity Part, UUID ItemID)
 {
     lock (StateSaveLock)
     {
         //if we did remove something, resave it
         if (Part.StateSaves.Remove(ItemID))
             Part.ParentEntity.HasGroupChanged = true;
     }
 }
开发者ID:VirtualReality,项目名称:Universe,代码行数:9,代码来源:ScriptDataSerializers.cs

示例6: Initialize

        public void Initialize (IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;
            ScriptProtection = module;

            m_comms = World.RequestModuleInterface<IScriptModuleComms>();
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:10,代码来源:MOD_Api.cs

示例7: Deserialization

 public void Deserialization (ISceneChildEntity obj, XmlTextReader reader)
 {
     string components = reader.ReadElementContentAsString ("Components", string.Empty);
     if (components != "") {
         try {
             DeserializeComponents (obj, components);
         } catch (Exception ex) {
             MainConsole.Instance.Warn ("[Component manager]: Error on deserializing Components! " + ex);
         }
     }
 }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:11,代码来源:ComponentManager.cs

示例8: PlaybackState

        public void PlaybackState (ISceneChildEntity part)
        {
            if (part != null)
            {
                part.Undoing = true;

                bool ChangedScale = false;
                bool ChangedPos = false;

                if (part.UUID == part.ParentEntity.UUID)
                {
                    if (Position != Vector3.Zero)
                    {
                        ChangedPos = true;
                        part.ParentEntity.AbsolutePosition = Position;
                    }

                    part.SetRotationOffset (true, Rotation, true);
                    if (Scale != Vector3.Zero)
                    {
                        ChangedScale = true;
                        part.Scale = Scale;
                    }

                    foreach (
                        ISceneChildEntity child in
                            part.ParentEntity.ChildrenEntities ().Where (child => child.UUID != part.UUID)) {
                        child.Undo (); //No updates here, child undo will do it on their own
                    }
                } else {
                    if (Position != Vector3.Zero)
                    {
                        ChangedPos = true;
                        part.FixOffsetPosition (Position, false);
                    }

                    part.UpdateRotation (Rotation);
                    if (Scale != Vector3.Zero)
                    {
                        ChangedScale = true;
                        part.Resize (Scale);
                    }
                }

                part.Undoing = false;
                var updateFlags =
                    (ChangedScale ? PrimUpdateFlags.Shape : PrimUpdateFlags.None) |
                    (ChangedPos ? PrimUpdateFlags.Position : PrimUpdateFlags.None) |
                    PrimUpdateFlags.Rotation;

                part.ScheduleUpdate (updateFlags);
            }
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:53,代码来源:UndoState.cs

示例9: UndoState

 public UndoState (ISceneChildEntity part)
 {
     if (part != null) {
         if (part.UUID == part.ParentEntity.UUID) {
             Position = part.ParentEntity.AbsolutePosition;
             Rotation = part.GetRotationOffset ();
             Scale = part.Shape.Scale;
         } else {
             Position = part.OffsetPosition;
             Rotation = part.GetRotationOffset ();
             Scale = part.Shape.Scale;
         }
     }
 }
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:14,代码来源:UndoState.cs

示例10: Initialize

        //internal IWindLightSettingsModule m_lightShareModule;

        public void Initialize(IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;
            ScriptProtection = module;

            if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
                m_LSFunctionsEnabled = true;

            m_comms = World.RequestModuleInterface<IScriptModuleComms>();
            if (m_comms == null)
                m_LSFunctionsEnabled = false;
        }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:17,代码来源:LS_Api.cs

示例11: Compare

 public bool Compare (ISceneChildEntity part)
 {
     if (part != null) {
         if (part.UUID == part.ParentEntity.UUID) {
             if (Position == part.AbsolutePosition && Rotation == part.GetRotationOffset () &&
                 Scale == part.Shape.Scale)
                 return true;
             return false;
         }
         if (Position == part.OffsetPosition && Rotation == part.GetRotationOffset () &&
             Scale == part.Shape.Scale)
             return true;
         return false;
     }
     return false;
 }
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:16,代码来源:UndoState.cs

示例12: Initialize

        public void Initialize(IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;

            if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
                m_OSFunctionsEnabled = true;

            m_ScriptDelayFactor =
                    m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f);
            m_ScriptDistanceFactor =
                    m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
            ScriptProtection = module;
        }
开发者ID:Krazy-Bish-Margie,项目名称:Aurora-Sim,代码行数:16,代码来源:OSSL_Api.cs

示例13: ObjectPhysicsProperties

        public static OSD ObjectPhysicsProperties(ISceneChildEntity[] entities)
        {
            ObjectPhysicsPropertiesMessage message = new ObjectPhysicsPropertiesMessage();
#if (!ISWIN)
            int i = 0;
            foreach (ISceneChildEntity entity in entities)
            {
                if (entity != null) i++;
            }
#else
            int i = entities.Count(entity => entity != null);
#endif

            message.ObjectPhysicsProperties = new Primitive.PhysicsProperties[i];
            i = 0;
#if (!ISWIN)
            foreach (ISceneChildEntity entity in entities)
            {
                if (entity != null)
                {
                    message.ObjectPhysicsProperties[i] = new Primitive.PhysicsProperties
                                                             {
                                                                 Density = entity.Density,
                                                                 Friction = entity.Friction,
                                                                 GravityMultiplier = entity.GravityMultiplier,
                                                                 LocalID = entity.LocalId,
                                                                 PhysicsShapeType =
                                                                     (PhysicsShapeType) entity.PhysicsType,
                                                                 Restitution = entity.Restitution
                                                             };
                    i++;
                }
            }
#else
            foreach (ISceneChildEntity entity in entities.Where(entity => entity != null))
            {
                message.ObjectPhysicsProperties[i] = new Primitive.PhysicsProperties
                                                         {
                                                             Density = entity.Density,
                                                             Friction = entity.Friction,
                                                             GravityMultiplier = entity.GravityMultiplier,
                                                             LocalID = entity.LocalId,
                                                             PhysicsShapeType = (PhysicsShapeType) entity.PhysicsType,
                                                             Restitution = entity.Restitution
                                                         };
                i++;
            }
#endif

            OSDMap m = new OSDMap {{"message", OSD.FromString("ObjectPhysicsProperties")}};
            OSD message_body = message.Serialize();
            m.Add("body", message_body);
            return m;
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:54,代码来源:EventQueueHelper.cs

示例14: DeleteFrom

 public void DeleteFrom(ISceneChildEntity Part, UUID ItemID)
 {
     OSDMap component = m_manager.GetComponentState(Part, m_componentName) as OSDMap;
     //Attempt to find the state saves we have
     if (component != null)
     {
         //if we did remove something, resave it
         if (component.Remove(ItemID.ToString()))
         {
             if (component.Count == 0)
                 m_manager.RemoveComponentState(Part.UUID, m_componentName);
             else
                 m_manager.SetComponentState(Part, m_componentName, component);
             Part.ParentEntity.HasGroupChanged = true;
         }
     }
 }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:17,代码来源:ScriptDataSerializers.cs

示例15: TriggerScriptLandCollidingEnd

 public void TriggerScriptLandCollidingEnd (ISceneChildEntity part, ColliderArgs colliders)
 {
     ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd;
     if (handlerLandCollidingEnd != null)
     {
         foreach (ScriptColliding d in handlerLandCollidingEnd.GetInvocationList ())
         {
             try
             {
                 d (part, colliders);
             }
             catch (Exception e)
             {
                 m_log.ErrorFormat (
                     "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing.  {0} {1}",
                     e.ToString (), e.StackTrace);
             }
         }
     }
 }
开发者ID:salahzar,项目名称:Aurora-Sim,代码行数:20,代码来源:ISceneEntity.cs


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