Ejemplo n.º 1
0
        /// <summary>
        /// Not meant to be called manually.
        /// </summary>
        public void Transition(int AnimationID, int LayerID)
        {
            string animation;
            var    length = GlobalTransitionDuration;

            if (Animations.TryGetValue(AnimationID, out animation))
            {
                SpriterAnimator.Transition(animation, length);
            }
        }
Ejemplo n.º 2
0
 private void Transition(int offset)
 {
     animator.Transition(GetAnimation(animator, offset), TransitionTime * 1000.0f);
 }
        /// Initialize the animatior
        private void InitAnimator()
        {
            SpriterEntity entity = SpriterData.Spriter.Entities[EntityIndex];
              AudioSource audioSource = gameObject.GetComponent<AudioSource>();

              SpriterAnimator = new UnitySpriterAnimator(entity, ChildData, audioSource);
              RegisterSpritesAndSounds();

              if (UseNativeTags) defaultTag = gameObject.tag;

              if (!String.IsNullOrEmpty(DefaultAnimation)) {
            N.Console.Log("Trying to set animation {0}", DefaultAnimation);
            foreach (var i in SpriterAnimator.GetAnimations()) {
              N.Console.Log(i);
            }
            SpriterAnimator.Transition(DefaultAnimation, 0);
              }
              SpriterAnimator.Step(0);
        }