本文整理汇总了C#中AvatarAppearance.GetAssetsFrom方法的典型用法代码示例。如果您正苦于以下问题:C# AvatarAppearance.GetAssetsFrom方法的具体用法?C# AvatarAppearance.GetAssetsFrom怎么用?C# AvatarAppearance.GetAssetsFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvatarAppearance
的用法示例。
在下文中一共展示了AvatarAppearance.GetAssetsFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AvatarIsWearing
//.........这里部分代码省略.........
Owner = client.AgentId,
CurrentPermissions = 0,
CreatorId = UUID.Zero.ToString(),
AssetID = module.DefaultUndershirt
};
//Locked
client.SendInventoryItemCreateUpdate(item, 0);
}
else if (wear.Type == 11 & wear.ItemID == UUID.Zero)
{
NeedsRebake = true;
InventoryItemBase item = new InventoryItemBase(UUID.Random())
{
InvType = (int) InventoryType.Wearable,
AssetType = (int) AssetType.Clothing,
Name = "Default Undershirt",
Folder =
m_scene.InventoryService.GetFolderForType(client.AgentId,
InventoryType.
Wearable,
AssetType.
Clothing).ID,
Owner = client.AgentId,
CurrentPermissions = 0
};
//Locked
if (m_underShirtUUID == UUID.Zero)
{
m_underShirtUUID = UUID.Random();
AssetBase asset = new AssetBase(m_underShirtUUID, "Default Undershirt", AssetType.Clothing,
UUID.Zero) {Data = Utils.StringToBytes(m_defaultUnderShirt)};
asset.FillHash();
asset.ID = m_scene.AssetService.Store(asset);
m_underShirtUUID = asset.ID;
}
item.CreatorId = UUID.Zero.ToString();
item.AssetID = m_underShirtUUID;
m_scene.InventoryService.AddItem(item);
client.SendInventoryItemCreateUpdate(item, 0);
wear.ItemID = item.ID;
}
}
}
#if (!ISWIN)
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
{
if (wear.Type < AvatarWearable.MAX_WEARABLES)
{
/*if (incomingLinks.ContainsKey (wear.ItemID))
{
wear.ItemID = incomingLinks[wear.ItemID];
}*/
avatAppearance.Wearables[wear.Type].Add(wear.ItemID, UUID.Zero);
}
}
#else
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing.Where(wear => wear.Type < AvatarWearable.MAX_WEARABLES))
{
avatAppearance.Wearables[wear.Type].Add(wear.ItemID, UUID.Zero);
}
#endif
avatAppearance.GetAssetsFrom(appearance.Appearance);
// This could take awhile since it needs to pull inventory
SetAppearanceAssets(sp.UUID, ref avatAppearance);
// could get fancier with the locks here, but in the spirit of "last write wins"
// this should work correctly, also, we don't need to send the appearance here
// since the "iswearing" will trigger a new set of visual param and baked texture changes
// when those complete, the new appearance will be sent
appearance.Appearance = avatAppearance;
if (NeedsRebake)
{
//Tell the client about the new things it is wearing
sp.ControllingClient.SendWearables(appearance.Appearance.Wearables, appearance.Appearance.Serial);
//Then forcefully tell it to rebake
#if (!ISWIN)
foreach (Primitive.TextureEntryFace t in appearance.Appearance.Texture.FaceTextures)
{
Primitive.TextureEntryFace face = (t);
if (face != null)
{
sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID);
}
}
#else
foreach (Primitive.TextureEntryFace face in appearance.Appearance.Texture.FaceTextures.Select(t => (t)).Where(face => face != null))
{
sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID);
}
#endif
}
QueueAppearanceSave(sp.UUID);
//Send the wearables HERE so that the client knows what it is wearing
//sp.ControllingClient.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial);
//Do not save or send the appearance! The client loops back and sends a bunch of SetAppearance
// (handled above) and that takes care of it
}