Esempio n. 1
0
        public void Play_WithChildren_IgnoreParent()
        {
            var child = Substitute.For <IAnimator>();

            child.ChildMode.Returns(AnimatorChildMode.IgnoreParent);
            _animator.SetChildren(new IAnimator[] { child });
            _animator.Play(_clip);
            child.DidNotReceive().Play(_clip);
            child.DidNotReceive().Play(_clip.Name);
        }
Esempio n. 2
0
        void Start()
        {
            if (_animateChildren)
            {
                var childAnimators = GetComponentsInChildren <IAnimator>().Where(x => !x.Equals(this)).ToArray();
                _frameAnimator.SetChildren(childAnimators);
            }

            // Start first animation
            if (!_frameAnimator.IsPlaying && _clips != null && _clips.Length > 0)
            {
                _frameAnimator.Play(_clips[0]);
            }
        }