private void SetState(eProcessType type) { if (enemyStatus != null) { switch (type) { case eProcessType.Type_Move: SetAnimation(type, motionNameArray[(int)type], true); break; case eProcessType.Type_Attack: SetAnimation(type, motionNameArray[(int)type], true); break; case eProcessType.Type_Damage: SetAnimation(type, motionNameArray[(int)type], false); break; case eProcessType.Type_Death: SetAnimation(type, motionNameArray[(int)type], false); break; } enemyStatus.SetState(type); } }
public void SetAnimation(eProcessType type, string name, bool isLoop) { if (skeletonAnim != null) { skeletonAnim.state.ClearTracks(); skeletonAnim.state.SetAnimation((int)type, name, isLoop); } }
private void MotionEndCB(Spine.AnimationState state, int trackIndex) { if (enemyStatus.prevProcessType.Equals(eProcessType.Type_None) == false && enemyStatus.prevProcessType.Equals(enemyStatus.processType) == false) { switch (enemyStatus.processType) { case eProcessType.Type_Damage: eProcessType prevType = enemyStatus.prevProcessType; enemyStatus.processType = eProcessType.Type_None; SetState(prevType); break; case eProcessType.Type_Death: OnDeath(); if (PoolManager.Instance != null) { PoolManager.Instance.AddEnemyPool(this); } break; } } }
public void SetState(eProcessType type) { prevProcessType = processType; processType = type; }