本文整理汇总了C#中OpenSim.Framework.AvatarAppearance.SetWearables方法的典型用法代码示例。如果您正苦于以下问题:C# AvatarAppearance.SetWearables方法的具体用法?C# AvatarAppearance.SetWearables怎么用?C# AvatarAppearance.SetWearables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Framework.AvatarAppearance
的用法示例。
在下文中一共展示了AvatarAppearance.SetWearables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Unpack
//.........这里部分代码省略.........
PreyAgent = args["prey_agent"].AsUUID();
if (args.ContainsKey("agent_access"))
Byte.TryParse(args["agent_access"].AsString(), out AgentAccess);
if (args.ContainsKey("active_group_id"))
ActiveGroupID = args["active_group_id"].AsUUID();
if ((args.ContainsKey("groups")) && (args["groups"]).Type == OSDType.Array)
{
OSDArray groups = (OSDArray)(args["groups"]);
Groups = new AgentGroupData[groups.Count];
int i = 0;
foreach (OSD o in groups)
{
if (o.Type == OSDType.Map)
{
Groups[i++] = new AgentGroupData((OSDMap)o);
}
}
}
if ((args.ContainsKey("animations")) && (args["animations"]).Type == OSDType.Array)
{
OSDArray anims = (OSDArray)(args["animations"]);
Anims = new Animation[anims.Count];
int i = 0;
foreach (OSD o in anims)
{
if (o.Type == OSDType.Map)
{
Anims[i++] = new Animation((OSDMap)o);
}
}
}
// Initialize an Appearance
Appearance = new AvatarAppearance(AgentID);
if (args.ContainsKey("texture_entry"))
{
byte[] data = args["texture_entry"].AsBinary();
Primitive.TextureEntry textureEntries = new Primitive.TextureEntry(data, 0, data.Length);
Appearance.SetTextureEntries(textureEntries);
}
if (args.ContainsKey("visual_params"))
{
byte[] visualParams = args["visual_params"].AsBinary();
Appearance.SetVisualParams(visualParams);
}
if ((args.ContainsKey("wearables")) && (args["wearables"]).Type == OSDType.Array)
{
OSDArray wears = (OSDArray)(args["wearables"]);
List<AvatarWearable> wearables = new List<AvatarWearable>();
int offset = 0;
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
{
if ((offset + 1) < wears.Count)
{
UUID itemID = wears[offset++].AsUUID();
UUID assetID = wears[offset++].AsUUID();
wearables.Add(new AvatarWearable(i, itemID, assetID));
}
else
{
break;
}
}
Appearance.SetWearables(wearables);
}
if (args.ContainsKey("callback_uri"))
CallbackURI = args["callback_uri"].AsString();
if (args.ContainsKey("avatar_as_a_prim"))
AvatarAsAPrim = args["avatar_as_a_prim"].AsBoolean();
if (args.ContainsKey("sat_on_group"))
{
SatOnGroup = args["sat_on_group"].AsUUID();
SatOnPrim = args["sat_on_prim"].AsUUID();
try
{
// "sit_offset" previously used OSD.FromVector3(vec) was used to store the data.
// Other Vector3 storage uses OSD.FromString(vec.ToString()).
// If originating from old region code, that will still be the case
// and the TryParse will trigger a format exception.
Vector3.TryParse(args["sit_offset"].ToString(), out SatOnPrimOffset);
}
catch (Exception)
{
// The following is compatible with OSD.FromVector3(vec), since Vector3.TryParse is not.
SatOnPrimOffset = args["sit_offset"].AsVector3();
}
}
}