コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: PackedAppearance.cs プロジェクト: kf6kjg/halcyon
        internal static PackedAppearance FromAppearance(AvatarAppearance avatarAppearance)
        {
            PackedAppearance app = new PackedAppearance
            {
                TextureEntry = avatarAppearance.Texture.GetBytes(),
                VisualParams = avatarAppearance.VisualParams,
                Wearables = PackedWearable.FromWearables(avatarAppearance.GetWearables()),
                Serial = avatarAppearance.Serial
            };

            return app;
        }
コード例 #3
0
        internal static PackedAppearance FromAppearance(AvatarAppearance avatarAppearance)
        {
            PackedAppearance app = new PackedAppearance
            {
                TextureEntry = avatarAppearance.Texture.GetBytes(),
                VisualParams = avatarAppearance.VisualParams,
                Wearables    = PackedWearable.FromWearables(avatarAppearance.GetWearables()),
                Serial       = avatarAppearance.Serial
            };

            return(app);
        }