本文整理汇总了C#中LSL_Types.ToVector3方法的典型用法代码示例。如果您正苦于以下问题:C# LSL_Types.ToVector3方法的具体用法?C# LSL_Types.ToVector3怎么用?C# LSL_Types.ToVector3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LSL_Types
的用法示例。
在下文中一共展示了LSL_Types.ToVector3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NpcCreate
LSL_Key NpcCreate(
string firstname, string lastname, LSL_Types.Vector3 position, string notecard, bool owned, bool senseAsAgent)
{
IBotManager manager = World.RequestModuleInterface<IBotManager>();
if (manager != null)
{
MainConsole.Instance.DebugFormat ("Creating NPC: {0} {1}, Position: {2}, Appearence: {3}, Options: {4} {5}",
firstname, lastname, position, notecard, owned, senseAsAgent);
// check for notecard or UUID for appearance...
AvatarAppearance appearance = null;
UUID appearanceId;
UUID.TryParse (notecard, out appearanceId);
if (appearanceId == UUID.Zero)
{
// not a UUID so try for a notecard
string appearanceSerialized = LoadNotecard(notecard);
if (appearanceSerialized != null)
{
var appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized);
appearance = new AvatarAppearance();
appearance.Unpack(appearanceOsd);
}
else
{
OSSLError(string.Format("osNpcCreate: Notecard reference '{0}' not found.", notecard));
}
}
UUID ownerID = UUID.Zero;
if (owned)
ownerID = m_host.OwnerID;
var npcPosition = position.ToVector3();
UUID newBotId;
if (appearance == null)
{
newBotId = manager.CreateAvatar (
firstname,
lastname,
World,
appearanceId,
ownerID,
npcPosition
);
} else
{
newBotId = manager.CreateAvatar (
firstname,
lastname,
World,
appearance,
ownerID,
npcPosition
);
}
return new LSL_Key(newBotId.ToString());
}
return new LSL_Key(UUID.Zero.ToString());
}