public SpriteAnimator(Material material, int columnCount) { this.material = material; this.spriteSheetColumnCount = columnCount; this.Sequences = new List<SpriteAnimationSequence>(); this.Settings = new SpriteAnimationSettings(); }
public CharacterState(string stateName, int priority, int animationPriority, SpriteAnimationSettings spriteAnimationSettings) { this.StateName = stateName; this.Priority = priority; this.AnimationPriority = animationPriority; this.SpriteAnimationSettings = spriteAnimationSettings; this.IncompatibleStates = new List<CharacterState>(); this.SpriteAnimationSequences = new List<SpriteAnimationSequence>(); this.SpriteTransitionAnimationSequences = new Dictionary<CharacterState, SpriteAnimationSequence>(); this.IsActive = false; }
private void InitializeStates() { SpriteAnimationSettings defaultAnimationSettings = new SpriteAnimationSettings(true); hitMissState = new CharacterState("Hit Miss", HIT_MISS_STATE_PRIORITY, HIT_MISS_STATE_ANIMATION_PRIORITY, defaultAnimationSettings); hitMissState.SpriteAnimationSequences = new List<SpriteAnimationSequence> { hitMissSequence }; hitState = new CharacterState("Hit", HIT_STATE_PRIORITY, HIT_STATE_ANIMATION_PRIORITY, defaultAnimationSettings); hitState.SpriteAnimationSequences = new List<SpriteAnimationSequence> { hitSequence1, hitSequence2, hitSequence3 }; comboHitState = new CharacterState("Combo Hit", COMBO_HIT_STATE_PRIORITY, COMBO_HIT_STATE_ANIMATION_PRIORITY, defaultAnimationSettings); comboHitState.SpriteAnimationSequences = new List<SpriteAnimationSequence> { comboHitSequence1, comboHitSequence2 }; comboHitState.AddIncompatibleStates(new CharacterState[] { hitState, hitMissState }); hypeAttackState = new CharacterState("Hype Attack State", HYPE_ATTACK_STATE_PRIORITY, HYPE_ATTACK_STATE_ANIMATION_PRIORITY, defaultAnimationSettings); hypeAttackState.SpriteAnimationSequences = new List<SpriteAnimationSequence> { hypeAttackSequence }; hypeAttackState.AddIncompatibleStates(new CharacterState[] { hitState, hitMissState }); deadState = new CharacterState("Dead", DEAD_STATE_PRIORITY, DEAD_STATE_ANIMATION_PRIORITY, defaultAnimationSettings); deadState.SpriteAnimationSequences = new List<SpriteAnimationSequence> { deathSequence }; deadState.AddIncompatibleStates(new CharacterState[] { hitState, hitMissState , comboHitState, hypeAttackState }); idleState = new CharacterState("Idle", IDLE_STATE_PRIORITY, IDLE_STATE_ANIMATION_PRIORITY, defaultAnimationSettings); idleState.SpriteAnimationSequences = new List<SpriteAnimationSequence> { idleSequence1, idleSequence2 }; bossStateController.AddState(idleState); }