本文整理汇总了C#中ISceneChildEntity类的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity类的具体用法?C# ISceneChildEntity怎么用?C# ISceneChildEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISceneChildEntity类属于命名空间,在下文中一共展示了ISceneChildEntity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: TriggerControlEvent
public void TriggerControlEvent (ISceneChildEntity part, UUID scriptUUID, UUID avatarID, uint held, uint _changed)
{
ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent;
if (handlerScriptControlEvent != null)
{
foreach (ScriptControlEvent d in handlerScriptControlEvent.GetInvocationList ())
{
try
{
d (part, scriptUUID, avatarID, held, _changed);
}
catch (Exception e)
{
m_log.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}",
e.ToString (), e.StackTrace);
}
}
}
}
开发者ID:salahzar,项目名称:Aurora-Sim,代码行数:20,代码来源:ISceneEntity.cs
示例17: TriggerRezScripts
public void TriggerRezScripts (ISceneChildEntity part, TaskInventoryItem[] taskInventoryItem, int startParam, bool postOnRez, int stateSource, UUID RezzedFrom)
{
NewRezScripts handlerRezScripts = OnRezScripts;
if (handlerRezScripts != null)
{
foreach (NewRezScripts d in handlerRezScripts.GetInvocationList ())
{
try
{
d (part, taskInventoryItem, startParam, postOnRez, stateSource, RezzedFrom);
}
catch (Exception e)
{
m_log.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}",
e.ToString (), e.StackTrace);
}
}
}
}
开发者ID:salahzar,项目名称:Aurora-Sim,代码行数:20,代码来源:ISceneEntity.cs
示例18: TriggerObjectDeGrab
public void TriggerObjectDeGrab (ISceneChildEntity part, ISceneChildEntity child, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
if (handlerObjectDeGrab != null)
{
foreach (ObjectDeGrabDelegate d in handlerObjectDeGrab.GetInvocationList ())
{
try
{
d (part, child, remoteClient, surfaceArgs);
}
catch (Exception e)
{
m_log.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}",
e.ToString (), e.StackTrace);
}
}
}
}
开发者ID:salahzar,项目名称:Aurora-Sim,代码行数:20,代码来源:ISceneEntity.cs
示例19: rez_scripts
/// <summary>
/// Start multiple scripts in the object
/// </summary>
/// <param name="part"></param>
/// <param name="items"></param>
/// <param name="startParam"></param>
/// <param name="postOnRez"></param>
/// <param name="engine"></param>
/// <param name="stateSource"></param>
/// <param name="RezzedFrom"></param>
public void rez_scripts(ISceneChildEntity part, TaskInventoryItem[] items,
int startParam, bool postOnRez, StateSource stateSource, UUID RezzedFrom)
{
List<LUStruct> ItemsToStart = new List<LUStruct>();
foreach (TaskInventoryItem item in items)
{
LUStruct itemToQueue = m_scriptEngine.StartScript(part, item.ItemID,
startParam, postOnRez, stateSource, RezzedFrom);
if (itemToQueue.Action != LUType.Unknown)
ItemsToStart.Add(itemToQueue);
}
if (ItemsToStart.Count != 0)
m_scriptEngine.MaintenanceThread.AddScriptChange(ItemsToStart.ToArray(), LoadPriority.FirstStart);
}
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:24,代码来源:EventManager.cs
示例20: control
public void control (ISceneChildEntity part, UUID itemID, UUID agentID, uint held, uint change)
{
if(part == null)
return;
ScriptData ID = ScriptEngine.ScriptProtection.GetScript(part.UUID, itemID);
if (ID == null)
return;
string functionName = "control";
object[] param = new object[] {
new LSL_Types.LSLString(agentID.ToString()),
new LSL_Types.LSLInteger(held),
new LSL_Types.LSLInteger(change)};
if (CheckIfEventShouldFire(ID, functionName, param))
m_scriptEngine.AddToScriptQueue(ID, functionName, new DetectParams[0], EventPriority.FirstStart, param);
}
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:18,代码来源:EventManager.cs
注:本文中的ISceneChildEntity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论