public void Start()
        {
            SpriterEntity entity      = SpriterData.Spriter.Entities[EntityIndex];
            AudioSource   audioSource = gameObject.GetComponent <AudioSource>();

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

            if (UseNativeTags)
            {
                defaultTag = gameObject.tag;
            }

            Animator.Step(0);
        }
Пример #2
0
        /// 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);
        }