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


C# LSL_Types.ToVector3方法代码示例

本文整理汇总了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());
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:65,代码来源:OS_Api.cs


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