SpineSkeletonTests AddAnimation Method Delta Engine Documentation

Namespace: DeltaEngine.Rendering2D.Spine.Tests
Assembly: DeltaEngine.Rendering2D.Spine.Tests (in DeltaEngine.Rendering2D.Spine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void AddAnimation()
Examples

[Test, CloseAfterFirstFrame]
public void AddAnimation()
{
    spineboy.SetAnimation("walk");
    spineboy.AddAnimation("jump", 0.2f);
    Assert.AreEqual(walk, spineboy.state.GetCurrent(0).Animation);
    AdvanceTimeAndUpdateEntities(0.5f);
    Assert.AreEqual(jump, spineboy.state.GetCurrent(0).Animation);
}
[Test, CloseAfterFirstFrame, Timeout(5000)]
public void AddAnimationEnds()
{
    bool isFinished = false;
    spineboy.SetAnimation("walk");
    spineboy.AddAnimation("jump", () => isFinished = true, 0.2f);
    AdvanceTimeAndUpdateEntities(2.5f);
    Assert.IsTrue(isFinished);
}
[Test, CloseAfterFirstFrame]
public void AddAnimationForTrack1()
{
    spineboy.AddAnimation("walk", 0.1f, 1);
    Assert.AreEqual(walk, spineboy.state.GetCurrent(1).Animation);
}
See Also