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


C# Framework.AvatarWearable类代码示例

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


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

示例1: AvatarAppearance

        public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, Primitive.TextureEntry textureEntry,
                                byte[] visualParams)
        {
            //            MainConsole.Instance.WarnFormat("[AVATAR APPEARANCE] create initialized appearance for {0}",avatarID);

            m_serial = 1;
            m_owner = avatarID;

            if (wearables != null)
                m_wearables = wearables;
            else
                SetDefaultWearables();

            if (textureEntry != null)
                m_texture = textureEntry;
            else
                SetDefaultTexture();

            if (visualParams != null)
                m_visualparams = visualParams;
            else
                SetDefaultParams();

            SetHeight();

            m_attachments = new Dictionary<int, List<AvatarAttachment>>();
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:27,代码来源:AvatarAppearance.cs

示例2: Unpack


//.........这里部分代码省略.........
                    if (o.Type == OSDType.Map)
                    {
                        Anims[i++] = new Animation((OSDMap)o);
                    }
                }
            }

            //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
            //{
            //    OSDArray textures = (OSDArray)(args["agent_textures"]);
            //    AgentTextures = new UUID[textures.Count];
            //    int i = 0;
            //    foreach (OSD o in textures)
            //        AgentTextures[i++] = o.AsUUID();
            //}

            Appearance = new AvatarAppearance();

            // The code to unpack textures, visuals, wearables and attachments
            // should be removed; packed appearance contains the full appearance
            // This is retained for backward compatibility only
            if (args["texture_entry"] != null)
            {
                byte[] rawtextures = args["texture_entry"].AsBinary();
                Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length);
                Appearance.SetTextureEntries(textures);
            }

            if (args["visual_params"] != null)
                Appearance.SetVisualParams(args["visual_params"].AsBinary());

            if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
            {
                OSDArray wears = (OSDArray)(args["wearables"]);
                for (int i = 0; i < wears.Count / 2; i++) 
                {
                    AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]);
                    Appearance.SetWearable(i,awear);
                }
            }

            if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
            {
                OSDArray attachs = (OSDArray)(args["attachments"]);
                foreach (OSD o in attachs)
                {
                    if (o.Type == OSDType.Map)
                    {
                        // We know all of these must end up as attachments so we
                        // append rather than replace to ensure multiple attachments
                        // per point continues to work
//                        m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID);
                        Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
                    }
                }
            }
            // end of code to remove

            if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
                Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]);
            else
                m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance");

            if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
            {
                OSDArray controls = (OSDArray)(args["controllers"]);
                Controllers = new ControllerData[controls.Count];
                int i = 0;
                foreach (OSD o in controls)
                {
                    if (o.Type == OSDType.Map)
                    {
                        Controllers[i++] = new ControllerData((OSDMap)o);
                    }
                }
            }

            if (args["callback_uri"] != null)
                CallbackURI = args["callback_uri"].AsString();

            // Attachment objects
            if (args["attach_objects"] != null && args["attach_objects"].Type == OSDType.Array)
            {
                OSDArray attObjs = (OSDArray)(args["attach_objects"]);
                AttachmentObjects = new List<ISceneObject>();
                AttachmentObjectStates = new List<string>();
                foreach (OSD o in attObjs)
                {
                    if (o.Type == OSDType.Map)
                    {
                        OSDMap info = (OSDMap)o;
                        ISceneObject so = scene.DeserializeObject(info["sog"].AsString());
                        so.ExtraFromXmlString(info["extra"].AsString());
                        so.HasGroupChanged = info["modified"].AsBoolean();
                        AttachmentObjects.Add(so);
                        AttachmentObjectStates.Add(info["state"].AsString());
                    }
                }
            }
        }
开发者ID:4U2NV,项目名称:opensim,代码行数:101,代码来源:ChildAgentDataUpdate.cs

示例3: SetWearable

 public virtual void SetWearable(int wearableId, AvatarWearable wearable)
 {
     // DEBUG ON
     //          m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID);
     // DEBUG OFF
     m_wearables[wearableId].Clear();
     for (int i = 0; i < wearable.Count; i++)
         m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
 }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:9,代码来源:AvatarAppearance.cs

示例4: AvatarAppearance

        public AvatarAppearance(AvatarAppearance appearance, bool copyWearables)
        {
            //            m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");

            if (appearance == null)
            {
                m_serial = 1;
                m_owner = UUID.Zero;

                SetDefaultWearables();
                SetDefaultTexture();
                SetDefaultParams();
                SetHeight();

                m_attachments = new Dictionary<int, List<AvatarAttachment>>();

                return;
            }

            m_serial = appearance.Serial;
            m_owner = appearance.Owner;

            m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
            for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
                m_wearables[i] = new AvatarWearable();
            if (copyWearables && (appearance.Wearables != null))
            {
                for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
                    SetWearable(i, appearance.Wearables[i]);
            }

            m_texture = null;
            if (appearance.Texture != null)
            {
                byte[] tbytes = appearance.Texture.GetBytes();
                m_texture = new Primitive.TextureEntry(tbytes, 0, tbytes.Length);
            }

            m_visualparams = null;
            if (appearance.VisualParams != null)
                m_visualparams = (byte[])appearance.VisualParams.Clone();

            // Copy the attachment, force append mode since that ensures consistency
            m_attachments = new Dictionary<int, List<AvatarAttachment>>();
            foreach (AvatarAttachment attachment in appearance.GetAttachments())
                AppendAttachment(new AvatarAttachment(attachment));
        }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:47,代码来源:AvatarAppearance.cs

示例5: CopyWearablesAndAttachments

        /// <summary>
        /// This method is called by establishAppearance to do a copy all inventory items
        /// worn or attached to the Clothing inventory folder of the receiving avatar.
        /// In parallel the avatar wearables and attachments are updated.
        /// </summary>

        private void CopyWearablesAndAttachments(UUID destination, UUID source, AvatarAppearance avatarAppearance)
        {
            IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService;

            // Get Clothing folder of receiver
            InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, AssetType.Clothing);

            if (destinationFolder == null)
                throw new Exception("Cannot locate folder(s)");

            // Missing destination folder? This should *never* be the case
            if (destinationFolder.Type != (short)AssetType.Clothing)
            {
                destinationFolder = new InventoryFolderBase();
                
                destinationFolder.ID       = UUID.Random();
                destinationFolder.Name     = "Clothing";
                destinationFolder.Owner    = destination;
                destinationFolder.Type     = (short)AssetType.Clothing;
                destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID;
                destinationFolder.Version  = 1;
                inventoryService.AddFolder(destinationFolder);     // store base record
                m_log.ErrorFormat("[RADMIN]: Created folder for destination {0}", source);
            }

            // Wearables
            AvatarWearable[] wearables = avatarAppearance.Wearables;
            AvatarWearable wearable;

            for (int i=0; i<wearables.Length; i++)
            {
                wearable = wearables[i];
                if (wearable[0].ItemID != UUID.Zero)
                {
                    // Get inventory item and copy it
                    InventoryItemBase item = new InventoryItemBase(wearable[0].ItemID, source);
                    item = inventoryService.GetItem(item);

                    if (item != null)
                    {
                        InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination);
                        destinationItem.Name = item.Name;
                        destinationItem.Owner = destination;
                        destinationItem.Description = item.Description;
                        destinationItem.InvType = item.InvType;
                        destinationItem.CreatorId = item.CreatorId;
                        destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid;
                        destinationItem.CreatorData = item.CreatorData;
                        destinationItem.NextPermissions = item.NextPermissions;
                        destinationItem.CurrentPermissions = item.CurrentPermissions;
                        destinationItem.BasePermissions = item.BasePermissions;
                        destinationItem.EveryOnePermissions = item.EveryOnePermissions;
                        destinationItem.GroupPermissions = item.GroupPermissions;
                        destinationItem.AssetType = item.AssetType;
                        destinationItem.AssetID = item.AssetID;
                        destinationItem.GroupID = item.GroupID;
                        destinationItem.GroupOwned = item.GroupOwned;
                        destinationItem.SalePrice = item.SalePrice;
                        destinationItem.SaleType = item.SaleType;
                        destinationItem.Flags = item.Flags;
                        destinationItem.CreationDate = item.CreationDate;
                        destinationItem.Folder = destinationFolder.ID;
                        ApplyNextOwnerPermissions(destinationItem);

                        m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
                        m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID);

                        // Wear item
                        AvatarWearable newWearable = new AvatarWearable();
                        newWearable.Wear(destinationItem.ID, wearable[0].AssetID);
                        avatarAppearance.SetWearable(i, newWearable);
                    }
                    else
                    {
                        m_log.WarnFormat("[RADMIN]: Error transferring {0} to folder {1}", wearable[0].ItemID, destinationFolder.ID);
                    }
                }
            }

            // Attachments
            List<AvatarAttachment> attachments = avatarAppearance.GetAttachments();

            foreach (AvatarAttachment attachment in attachments)
            {
                int attachpoint = attachment.AttachPoint;
                UUID itemID = attachment.ItemID;

                if (itemID != UUID.Zero)
                {
                    // Get inventory item and copy it
                    InventoryItemBase item = new InventoryItemBase(itemID, source);
                    item = inventoryService.GetItem(item);

                    if (item != null)
//.........这里部分代码省略.........
开发者ID:NovaGrid,项目名称:opensim,代码行数:101,代码来源:RemoteAdminPlugin.cs

示例6: SendWearables

 public virtual void SendWearables(AvatarWearable[] wearables, int serial)
 {
 }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:3,代码来源:MyNpcCharacter.cs

示例7: Unpack

        /// <summary>
        /// Unpack and OSDMap and initialize the appearance
        /// from it
        /// </summary>
        public void Unpack(OSDMap data)
        {
            if ((data != null) && (data["serial"] != null))
                m_serial = data["serial"].AsInteger();
            if ((data != null) && (data["height"] != null))
//                m_avatarHeight = (float)data["height"].AsReal();
                SetSize(new Vector3(0.45f,0.6f, (float)data["height"].AsReal()));

            try
            {
                // Wearables
                SetDefaultWearables();
                if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array)
                {
                    OSDArray wears = (OSDArray)(data["wearables"]);

                    int count = wears.Count;

                    m_wearables = new AvatarWearable[count];

                    for (int i = 0; i < count; i++)
                        m_wearables[i] = new AvatarWearable((OSDArray)wears[i]);
                }
                else
                {
                    m_log.Warn("[AVATAR APPEARANCE]: failed to unpack wearables");
                }

                // Avatar Textures
                SetDefaultTexture();
                if ((data != null) && (data["textures"] != null) && (data["textures"]).Type == OSDType.Array)
                {
                    OSDArray textures = (OSDArray)(data["textures"]);
                    for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT && i < textures.Count; i++)
                    {
                        UUID textureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
                        if (textures[i] != null)
                            textureID = textures[i].AsUUID();
                        m_texture.CreateFace((uint)i).TextureID = new UUID(textureID);
                    }
                }
                else
                {
                    m_log.Warn("[AVATAR APPEARANCE]: failed to unpack textures");
                }

                if ((data != null) && (data["bakedcache"] != null) && (data["bakedcache"]).Type == OSDType.Array)
                {
                    OSDArray bakedOSDArray = (OSDArray)(data["bakedcache"]);
                    m_cacheitems = WearableCacheItem.BakedFromOSD(bakedOSDArray);
                }

                // Visual Parameters
                SetDefaultParams();
                if ((data != null) && (data["visualparams"] != null))
                {
                    if ((data["visualparams"].Type == OSDType.Binary) || (data["visualparams"].Type == OSDType.Array))
                        m_visualparams = data["visualparams"].AsBinary();
                }
                else
                {
                    m_log.Warn("[AVATAR APPEARANCE]: failed to unpack visual parameters");
                }

                // Attachments
                m_attachments = new Dictionary<int, List<AvatarAttachment>>();
                if ((data != null) && (data["attachments"] != null) && (data["attachments"]).Type == OSDType.Array)
                {
                    OSDArray attachs = (OSDArray)(data["attachments"]);
                    for (int i = 0; i < attachs.Count; i++)
                    {
                        AvatarAttachment att = new AvatarAttachment((OSDMap)attachs[i]);
                        AppendAttachment(att);
                        
//                        m_log.DebugFormat(
//                            "[AVATAR APPEARANCE]: Unpacked attachment itemID {0}, assetID {1}, point {2}",
//                            att.ItemID, att.AssetID, att.AttachPoint);
                    }
                }
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[AVATAR APPEARANCE]: unpack failed badly: {0}{1}", e.Message, e.StackTrace);
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:89,代码来源:AvatarAppearance.cs

示例8: SetWearable

        public virtual void SetWearable(int wearableId, AvatarWearable wearable)
        {
// DEBUG ON
//          m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID);
// DEBUG OFF
            if (wearableId >= m_wearables.Length)
            {
                int currentLength = m_wearables.Length;
                Array.Resize(ref m_wearables, wearableId + 1);
                for (int i = currentLength ; i < m_wearables.Length ; i++)
                    m_wearables[i] = new AvatarWearable();
            }
            m_wearables[wearableId].Clear();
            for (int i = 0; i < wearable.Count; i++)
                m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:16,代码来源:AvatarAppearance.cs

示例9: WearablesToUUIDs

 private static UUID[] WearablesToUUIDs(AvatarWearable[] aws)
 {
     // We might not pass the Wearables in all cases...
     // They're only needed so that persistent changes to the appearance
     // are preserved in the new region where the user is moving to.
     // But in Hypergrid we might not let this happen.
     int i = 0;
     UUID[] wears = null;
     if (aws != null)
     {
         wears = new UUID[aws.Length * 2];
         foreach (AvatarWearable aw in aws)
         {
             if (aw != null)
             {
                 wears[i++] = aw.ItemID;
                 wears[i++] = aw.AssetID;
             }
             else
             {
                 wears[i++] = UUID.Zero;
                 wears[i++] = UUID.Zero;
             }
         }
     }
     return wears;
 }
开发者ID:diva,项目名称:Grider,代码行数:27,代码来源:OpenSimComms.cs

示例10: SetWearable

 public void SetWearable(int wearableId, AvatarWearable wearable)
 {
     m_appearance.SetWearable(wearableId, wearable);
     m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
     m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
 }
开发者ID:dirkhusemann,项目名称:opensim,代码行数:6,代码来源:ScenePresence.cs

示例11: SendWearables

 public void SendWearables(AvatarWearable[] wearables, int serial)
 {
     throw new System.NotImplementedException();
 }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:4,代码来源:VWHClientView.cs

示例12: GetAvatar

        // <summary>
        // </summary>
        // <param name=""></param>
        public AvatarData GetAvatar(UUID userID)
        {
            NameValueCollection requestArgs = new NameValueCollection
            {
                { "RequestMethod", "GetUser" },
                { "UserID", userID.ToString() }
            };

            OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
            if (response["Success"].AsBoolean())
            {
                OSDMap map = null;
                try { map = OSDParser.DeserializeJson(response["LLAppearance"].AsString()) as OSDMap; }
                catch { }

                if (map != null)
                {
                    AvatarWearable[] wearables = new AvatarWearable[13];
                    wearables[0] = new AvatarWearable(map["ShapeItem"].AsUUID(), map["ShapeAsset"].AsUUID());
                    wearables[1] = new AvatarWearable(map["SkinItem"].AsUUID(), map["SkinAsset"].AsUUID());
                    wearables[2] = new AvatarWearable(map["HairItem"].AsUUID(), map["HairAsset"].AsUUID());
                    wearables[3] = new AvatarWearable(map["EyesItem"].AsUUID(), map["EyesAsset"].AsUUID());
                    wearables[4] = new AvatarWearable(map["ShirtItem"].AsUUID(), map["ShirtAsset"].AsUUID());
                    wearables[5] = new AvatarWearable(map["PantsItem"].AsUUID(), map["PantsAsset"].AsUUID());
                    wearables[6] = new AvatarWearable(map["ShoesItem"].AsUUID(), map["ShoesAsset"].AsUUID());
                    wearables[7] = new AvatarWearable(map["SocksItem"].AsUUID(), map["SocksAsset"].AsUUID());
                    wearables[8] = new AvatarWearable(map["JacketItem"].AsUUID(), map["JacketAsset"].AsUUID());
                    wearables[9] = new AvatarWearable(map["GlovesItem"].AsUUID(), map["GlovesAsset"].AsUUID());
                    wearables[10] = new AvatarWearable(map["UndershirtItem"].AsUUID(), map["UndershirtAsset"].AsUUID());
                    wearables[11] = new AvatarWearable(map["UnderpantsItem"].AsUUID(), map["UnderpantsAsset"].AsUUID());
                    wearables[12] = new AvatarWearable(map["SkirtItem"].AsUUID(), map["SkirtAsset"].AsUUID());

                    AvatarAppearance appearance = new AvatarAppearance();
                    appearance.Wearables = wearables;
                    appearance.AvatarHeight = (float)map["Height"].AsReal();

                    AvatarData avatar = new AvatarData(appearance);
                    
                    // Get attachments
                    map = null;
                    try { map = OSDParser.DeserializeJson(response["LLAttachments"].AsString()) as OSDMap; }
                    catch { }

                    if (map != null)
                    {
                        foreach (KeyValuePair<string, OSD> kvp in map)
                            avatar.Data[kvp.Key] = kvp.Value.AsString();
                    }
                
                    return avatar;
                }
                else
                {
                    m_log.Warn("[SIMIAN AVATAR CONNECTOR]: Failed to get user appearance for " + userID +
                        ", LLAppearance is missing or invalid");
                    return null;
                }
            }
            else
            {
                m_log.Warn("[SIMIAN AVATAR CONNECTOR]: Failed to get user appearance for " + userID + ": " +
                    response["Message"].AsString());
            }

            return null;
        }
开发者ID:NovaGrid,项目名称:opensim,代码行数:69,代码来源:SimianAvatarServiceConnector.cs

示例13: CacheWearableData

 public void CacheWearableData(UUID principalID, AvatarWearable cachedWearable)
 {
 }
开发者ID:RevolutionSmythe,项目名称:Aurora-Sim,代码行数:3,代码来源:SimianAvatarServiceConnector.cs

示例14: Unpack


//.........这里部分代码省略.........

            // packed_appearence should contain all appearance information
            if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
            {
                m_log.WarnFormat("[CHILDAGENTDATAUPDATE] got packed appearance");
                Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]);
            }
            else
            {
                // if missing try the old pack method
                m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance, checking old method");

                Appearance = new AvatarAppearance();

                // The code to unpack textures, visuals, wearables and attachments
                // should be removed; packed appearance contains the full appearance
                // This is retained for backward compatibility only
                if (args["texture_entry"] != null)
                {
                    byte[] rawtextures = args["texture_entry"].AsBinary();
                    Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures, 0, rawtextures.Length);
                    Appearance.SetTextureEntries(textures);
                }

                if (args["visual_params"] != null)
                    Appearance.SetVisualParams(args["visual_params"].AsBinary());

                if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
                {
                    OSDArray wears = (OSDArray)(args["wearables"]);

                    for (int i = 0; i < wears.Count / 2; i++)
                    {
                        AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]);
                        Appearance.SetWearable(i, awear);
                    }
                }

                if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
                {
                    OSDArray attachs = (OSDArray)(args["attachments"]);
                    foreach (OSD o in attachs)
                    {
                        if (o.Type == OSDType.Map)
                        {
                            // We know all of these must end up as attachments so we
                            // append rather than replace to ensure multiple attachments
                            // per point continues to work
                            //                        m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID);
                            Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
                        }
                    }
                }
                // end of code to remove
            }
/* moved above
            if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
                Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]);
            else
                m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance");
*/
            if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
            {
                OSDArray controls = (OSDArray)(args["controllers"]);
                Controllers = new ControllerData[controls.Count];
                int i = 0;
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:67,代码来源:ChildAgentDataUpdate.cs

示例15: RemapWornItems

        private void RemapWornItems(UUID botID, AvatarAppearance appearance)
        {
            // save before Clear calls
            List<AvatarWearable> wearables = appearance.GetWearables();
            List<AvatarAttachment> attachments = appearance.GetAttachments();
            appearance.ClearWearables();
            appearance.ClearAttachments();

            // Remap bot outfit with new item IDs
            foreach (AvatarWearable w in wearables)
            {
                AvatarWearable newWearable = new AvatarWearable(w);
                // store a reversible back-link to the original inventory item ID.
                newWearable.ItemID = w.ItemID ^ botID;
                appearance.SetWearable(newWearable);
            }

            foreach (AvatarAttachment a in attachments)
            {
                // store a reversible back-link to the original inventory item ID.
                UUID itemID = a.ItemID ^ botID;
                appearance.SetAttachment(a.AttachPoint, true, itemID, a.AssetID);
            }
        }
开发者ID:MatthewBeardmore,项目名称:halcyon,代码行数:24,代码来源:BotManager.cs


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