本文整理汇总了C#中AssetManager.GetAnimatedTexture方法的典型用法代码示例。如果您正苦于以下问题:C# AssetManager.GetAnimatedTexture方法的具体用法?C# AssetManager.GetAnimatedTexture怎么用?C# AssetManager.GetAnimatedTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssetManager
的用法示例。
在下文中一共展示了AssetManager.GetAnimatedTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IntegrateChild
protected override bool IntegrateChild(AssetManager assets, LayoutTreeNode childNode)
{
bool orderError = false;
switch (childNode.Key)
{
case "Texture":
sprite = new Sprite(assets.GetAnimatedTexture(childNode.Value));
return true;
case "Position":
if (sprite != null)
{
sprite.Position = ExtendedConvert.ToVector2(childNode.Value);
return true;
}
else
orderError = true;
break;
case "Rotation":
if (sprite != null)
{
sprite.Rotation = Convert.ToSingle(childNode.Value);
return true;
}
else
orderError = true;
break;
case "Scale":
if (sprite != null)
{
sprite.Scale = ExtendedConvert.ToVector2(childNode.Value);
return true;
}
else
orderError = true;
break;
case "Color":
if (sprite != null)
{
sprite.Color = ExtendedConvert.ToColor(childNode.Value);
return true;
}
else
orderError = true;
break;
case "Anchor":
if (sprite != null)
{
sprite.Anchor = ExtendedConvert.ToEnum<Anchor>(childNode.Value);
return true;
}
else
orderError = true;
break;
case "Animation":
if (sprite != null)
{
AnimationCurveElement animationCurve = null;
switch (childNode.Value)
{
case "PeriodicCurve":
animationCurve = new PeriodicAnimationCurveElement();
break;
}
if (animationCurve != null)
{
animationCurve.Integrate(assets, childNode);
if (animationCurve.AnimationCurve != null)
{
sprite.PushAnimationCurve(animationCurve.AnimationCurve);
return true;
}
#if DEBUG
Console.WriteLine("LayoutEngine WARNING: An animation is missing an element.");
return true;
#endif
}
}
else
orderError = true;
break;
}
if (orderError)
{
#if DEBUG
Console.WriteLine("ContextElement WARNING: Tried to set {0}'s {1} field before the Texture was specified.", LayoutName, childNode.Key);
#endif
return true;
}
return false;
}