本文整理汇总了C#中IScriptInstance.AddSleepMS方法的典型用法代码示例。如果您正苦于以下问题:C# IScriptInstance.AddSleepMS方法的具体用法?C# IScriptInstance.AddSleepMS怎么用?C# IScriptInstance.AddSleepMS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScriptInstance
的用法示例。
在下文中一共展示了IScriptInstance.AddSleepMS方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: llInstantMessage
public void llInstantMessage(IScriptInstance script, string user, string message)
{
if (m_messaging != null)
{
UUID toID;
UUID.TryParse(user, out toID);
// Keep a persistent messageID for all IMs from the host object to the target agent
UUID messageID = UUID.Combine(script.Host.ID, toID);
m_messaging.SendInstantMessage(messageID, toID, script.Host.Name,
script.Host.ScenePosition, script.Host.Scene.ID, false,
InstantMessageDialog.MessageFromObject, message, false, DateTime.UtcNow,
Utils.EmptyBytes);
}
script.AddSleepMS(2000);
}
示例2: llSetText
public void llSetText(IScriptInstance script, string text, Vector3 color, float alpha)
{
SetText(script.Host, text, color, alpha);
script.AddSleepMS(200);
}
示例3: llSetTexture
public void llSetTexture(IScriptInstance script, string texture, int side)
{
if (script.Host is LLPrimitive)
SetTexture(script, (LLPrimitive)script.Host, texture, side);
script.AddSleepMS(200);
if (m_lslScriptEngine != null)
m_lslScriptEngine.PostObjectEvent(script.Host.ID, "changed", new object[] { LSLConstants.CHANGED_TEXTURE }, null);
}
示例4: llSetRot
public void llSetRot(IScriptInstance script, Quaternion rot)
{
SetRot(script.Host, rot);
script.AddSleepMS(200);
}
示例5: llSetScale
public void llSetScale(IScriptInstance script, Vector3 scale)
{
SetScale(script.Host, scale);
script.AddSleepMS(200);
}
示例6: llSetPos
public void llSetPos(IScriptInstance script, Vector3 pos)
{
SetPos(script.Host, pos);
script.AddSleepMS(200);
}
示例7: llSetRemoteScriptAccessPin
public void llSetRemoteScriptAccessPin(IScriptInstance script, int pin)
{
LLPrimitive prim = script.Host as LLPrimitive;
if (prim == null)
return;
prim.RemoteScriptAccessPIN = pin;
script.AddSleepMS(200);
}
示例8: llSetLocalRot
public void llSetLocalRot(IScriptInstance script, Quaternion rot)
{
script.Host.RelativeRotation = rot;
script.Host.Scene.EntityAddOrUpdate(this, script.Host, UpdateFlags.Rotation, 0);
script.AddSleepMS(200);
}
示例9: llSetColor
public void llSetColor(IScriptInstance script, Vector3 color, int side)
{
script.AddSleepMS(200);
if (script.Host is LLPrimitive)
{
SetColor((LLPrimitive)script.Host, color, side);
if (m_lslScriptEngine != null)
m_lslScriptEngine.PostObjectEvent(script.Host.ID, "changed", new object[] { LSLConstants.CHANGED_COLOR }, null);
}
}
示例10: RezObject
private void RezObject(IScriptInstance script, string inventory, Vector3 position, Vector3 vel, Quaternion rot, int param, bool atRoot)
{
// TODO: Test to make sure this actually rezzes from the root, and get the atRoot param working
// Can't do this without an IAssetClient
if (m_assetClient == null)
return;
// Sanity check the input rotation
if (Single.IsNaN(rot.X) || Single.IsNaN(rot.Y) || Single.IsNaN(rot.Z) || Single.IsNaN(rot.W))
return;
// Sanity check the distance, silently fail at > 10m
float dist = Vector3.Distance(script.Host.ScenePosition, position);
if (dist > 10.0f)
return;
if (script.Host is LLPrimitive)
{
LLPrimitive obj = (LLPrimitive)script.Host;
LLInventoryTaskItem item = obj.Inventory.FindItem(delegate(LLInventoryTaskItem match) { return match.Name == inventory; });
if (item != null)
{
// Make sure this is an object
if (item.InventoryType != InventoryType.Object)
{
llSay(script, 0, "Unable to create requested object. Object is missing from database.");
return;
}
// Fetch the serialized linkset asset
Asset linksetAsset;
if (!m_assetClient.TryGetAsset(item.AssetID, LLUtil.LLAssetTypeToContentType((int)AssetType.Object), out linksetAsset))
{
llSay(script, 0, "Unable to create requested object. Object is missing from database.");
return;
}
// Deserialize the asset to LLSD
OSDMap linksetMap = null;
try { linksetMap = OSDParser.Deserialize(linksetAsset.Data) as OSDMap; }
catch (Exception ex) { m_log.Error("Failed to deserialize linkset from asset " + linksetAsset.ID + ": " + ex.Message); }
if (linksetMap == null)
{
llSay(script, 0, "Unable to create requested object. Object is corrupted in database.");
return;
}
// Deserialize the linkset
IList<LLPrimitive> linkset = LLPrimitive.DeserializeLinkset(linksetMap, obj.Scene, m_primMesher, true);
Vector3 velocity = vel;
Quaternion rotation = rot;
float velMag = velocity.Length();
float mass = (float)llGetMass(script);
// Rez the parent(s) first
for (int i = 0; i < linkset.Count; i++)
{
LLPrimitive prim = linkset[i];
if (prim.Parent == null)
{
// Objects rezzed with this method are DieAtEdge by default
prim.Prim.Flags |= PrimFlags.DieAtEdge;
// Set the position, rotation and velocity of the root prim in the scene
prim.RelativePosition = position;
prim.RelativeRotation = rotation;
if (prim.Prim.Flags.HasFlag(PrimFlags.Physics))
{
prim.FallStart = Util.TickCount();
prim.Velocity = velocity;
}
obj.Scene.EntityAddOrUpdate(this, prim, UpdateFlags.FullUpdate, 0);
m_log.Debug("Deserialized root prim " + prim.ID + " (" + prim.LocalID + ") from task inventory");
}
}
// Rez the children
for (int i = 0; i < linkset.Count; i++)
{
LLPrimitive prim = linkset[i];
if (prim.Parent != null)
obj.Scene.EntityAddOrUpdate(this, prim, UpdateFlags.FullUpdate, 0);
}
// FIXME: Post an object_rez event
if (obj.Prim.Flags.HasFlag(PrimFlags.Physics))
{
obj.FallStart = Util.TickCount();
// FIXME: Recoil
//llApplyImpulse(script, new lsl_vector(velocity.X * mass, velocity.Y * mass, velocity.Z * mass), 0);
}
// Variable script delay (http://wiki.secondlife.com/wiki/LSL_Delay)
script.AddSleepMS((int)((mass * velMag) * 0.1f));
//.........这里部分代码省略.........
示例11: llSetPrimitiveParams
public void llSetPrimitiveParams(IScriptInstance script, object[] rules)
{
script.AddSleepMS(200);
SetPrimParams(script, script.Host, rules);
}
示例12: llPreloadSound
public void llPreloadSound(IScriptInstance script, string sound)
{
UUID soundID = KeyOrName(script, sound, AssetType.Sound);
if (soundID == UUID.Zero)
{
script.Host.Scene.EntityChat(this, script.Host, 0f, "Cannot find sound " + sound, Int32.MaxValue, EntityChatType.Debug);
return;
}
if (m_sounds != null)
m_sounds.PreloadSound(script.Host, soundID, DEFAULT_SOUND_RADIUS);
script.AddSleepMS(1000);
}