本文整理汇总了C#中Spine.AnimationState类的典型用法代码示例。如果您正苦于以下问题:C# AnimationState类的具体用法?C# AnimationState怎么用?C# AnimationState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnimationState类属于Spine命名空间,在下文中一共展示了AnimationState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Animation
public Animation(string AnimationFile)
{
skeletonRenderer = new SkeletonRenderer();
String name = AnimationFile;
Atlas atlas = new Atlas("Data/" + name + ".atlas", new GLImpTextureLoader());
SkeletonJson json = new SkeletonJson(atlas);
skeleton = new Skeleton(json.ReadSkeletonData("Data/" + name + ".json"));
skeleton.SetSlotsToSetupPose();
// Define mixing between animations.
stateData = new AnimationStateData(skeleton.Data);
state = new AnimationState(stateData);
//state.SetAnimation("idle", true);
skeleton.X = 0;
skeleton.Y = 0.1f;
skeleton.UpdateWorldTransform();
drawtime = new Stopwatch();
drawtime.Start();
Program.MiddleDrawQueue += Draw;
}
示例2: Initialize
public override void Initialize()
{
base.Initialize(); // Call overridden method to initialize the skeleton.
state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
}
示例3: Entity
public Entity(Skeleton skeleton, Vector2 position)
: this(position)
{
Skeleton = skeleton;
skeletonBoundingBox = ResourceManager.GetSkeletonBoundingBox(skeleton.Data.Name);
AnimationState = new AnimationState(new AnimationStateData(skeleton.Data));
RenderShadow = true;
}
示例4: Reset
public override void Reset () {
base.Reset();
if (!valid) return;
state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
if (_animationName != null && _animationName.Length > 0) {
state.SetAnimation(0, _animationName, loop);
Update(0);
}
}
示例5: Initialize
override public void Initialize () {
if (Initialized) return;
base.Initialize();
state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
}
示例6: Start
void Start () {
// Make sure you get these AnimationState and Skeleton references in Start or Later. Getting and using them in Awake is not guaranteed by default execution order.
skeletonAnimation = GetComponent<SkeletonAnimation>();
spineAnimationState = skeletonAnimation.state;
skeleton = skeletonAnimation.skeleton;
StartCoroutine(DoDemoRoutine());
}
示例7: SpineSkeleton
public SpineSkeleton(string atlasName, string skeletonName, Rectangle originAndScale)
{
skeleton = CreateSkeleton(atlasName, skeletonName);
skeleton.SetBonesToSetupPose();
stateData = new AnimationStateData(skeleton.Data);
state = new AnimationState(stateData);
LastOriginAndScale = OriginAndScale = originAndScale;
OnDraw<SpineRenderer>();
}
示例8: Initialize
/*
*/
private void Initialize()
{
mesh = new Mesh();
GetComponent<MeshFilter>().mesh = mesh;
mesh.name = "tk2dSkeleton Mesh";
mesh.hideFlags = HideFlags.HideAndDontSave;
state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
skeleton = new Skeleton(skeletonDataAsset.GetSkeletonData());
}
示例9: Subscribe
void Subscribe (Spine.AnimationState state, Spine.EventData eventDataReference, bool unsubscribe) {
if (state == null || eventDataReference == null) {
m_WasFired = true;
} else {
m_AnimationState = state;
m_TargetEvent = eventDataReference;
state.Event += HandleAnimationStateEvent;
m_unsubscribeAfterFiring = unsubscribe;
}
}
示例10: SubscribeByName
void SubscribeByName (Spine.AnimationState state, string eventName, bool unsubscribe) {
if (state == null || string.IsNullOrEmpty(eventName)) {
m_WasFired = true;
} else {
m_AnimationState = state;
m_EventName = eventName;
state.Event += HandleAnimationStateEventByName;
m_unsubscribeAfterFiring = unsubscribe;
}
}
示例11: SetAnimationStateData
public void SetAnimationStateData (AnimationStateData stateData ) {
if (stateData!=null)
OwnsAnimationStateData = false;
State = new AnimationState(stateData);
State.Event += OnEvent;
State.Start += OnStart;
State.Complete += OnComplete;
State.End += OnEnd;
}
示例12: SpinePlayer
public SpinePlayer(string atlasPath, string jsonPath)
{
Name = jsonPath;
_skeletonRenderer = new SkeletonRenderer(Render.Device);
var atlas = new Atlas(atlasPath, new XnaTextureLoader(Render.Device));
var json = new SkeletonJson(atlas);
Skeleton = new Skeleton(json.ReadSkeletonData(jsonPath));
Skeleton.SetSlotsToSetupPose(); // Without this the skin attachments won't be attached. See SetSkin.
var stateData = new AnimationStateData(Skeleton.Data);
State = new AnimationState(stateData);
IsVisible = true;
}
示例13: LoadContent
protected override void LoadContent()
{
Effect spriteBatchEffect = Content.Load<Effect>("SpriteBatchEffect");
spriteBatch = new SpriteBatchEx(GraphicsDevice, spriteBatchEffect);
Bone.yDown = true;
skeletonData = Content.Load<SkeletonData>("spineboy/spineboy");
skeleton = new Skeleton(skeletonData);
skeleton.SetSlotsToSetupPose();
AnimationStateData stateData = new AnimationStateData(skeleton.Data);
animationState = new AnimationState(stateData);
animationState.SetAnimation(0, "walk", true);
skeleton.UpdateWorldTransform();
}
示例14: Avatar
public Avatar(string AnimationFile)
{
SkeletonRenderer = new SkeletonRenderer(Vector3.UnitY, Vector3.UnitZ);
String name = AnimationFile;
Atlas atlas = new Atlas(name + ".atlas", new OpenTKTextureLoader());
SkeletonJson json = new SkeletonJson(atlas);
Skeleton = new Skeleton(json.ReadSkeletonData(name + ".json"));
Skeleton.SetSlotsToSetupPose();
// Define mixing between animations.
StateData = new AnimationStateData(Skeleton.Data);
State = new AnimationState(StateData);
Skeleton.X = 0;
Skeleton.Y = 0;
Skeleton.UpdateWorldTransform();
}
示例15: Subscribe
void Subscribe (Spine.AnimationState state, Spine.EventData eventDataReference, bool unsubscribe) {
#if PREUNITY_5_3
Debug.LogWarning("Unity 5.3 or later is required for Spine Unity custom yield instructions to function correctly.");
#endif
if (state == null) {
Debug.LogWarning("AnimationState argument was null. Coroutine will continue immediately.");
m_WasFired = true;
return;
} else if (eventDataReference == null) {
Debug.LogWarning("eventDataReference argument was null. Coroutine will continue immediately.");
m_WasFired = true;
return;
}
m_AnimationState = state;
m_TargetEvent = eventDataReference;
state.Event += HandleAnimationStateEvent;
m_unsubscribeAfterFiring = unsubscribe;
}