public void OnMeshAnimatorStop(MeshAnimator animator)
 {
     if (this.enabled && this.StopDelegate != null)
     {
         this.StopDelegate(animator);
     }
 }
        protected string GenerateKey(MeshAnimator animator)
        {
            string key;

            key = null;

            if (animator)
            {
                Transform transform;
                transform = animator.GetComponent <Transform>();

                if (transform != this.GetComponent <Transform>() && transform.IsChildOf(this.GetComponent <Transform>()))
                {
                    while (transform != this.GetComponent <Transform>())
                    {
                        if (key == null)
                        {
                            key = transform.name;
                        }
                        else
                        {
                            key = transform.name + "." + key;
                        }
                        transform = transform.parent;
                    }
                }
            }

            return(key);
        }
 public void OnMeshAnimatorPlay(MeshAnimator animator)
 {
     if (this.enabled && this.PlayDelegate != null)
     {
         this.PlayDelegate(animator);
     }
 }
        // ================================================================= //
        // Helper Methods
        // ================================================================= //

        protected void Apply(MeshAnimator animator, Block activate, Block deactivate)
        {
            if (animator && !this.Contains(animator))
            {
                animator = null;
            }

            foreach (MeshAnimator other in this.Animators)
            {
                if (other != null && other != animator)
                {
                    if (deactivate != null)
                    {
                        deactivate(other);
                    }
                    this.Toggle(other, false);
                }
            }

            if (animator != null)
            {
                this.Toggle(animator, true);
                if (activate != null)
                {
                    activate(animator);
                }
            }

            this.Animator = animator;
        }
 public void Solo(MeshAnimator animator)
 {
     this.Apply(
         animator,
         a => {
         this.Toggle(a, true);
     },
         a => {
         this.Toggle(a, false);
     }
         );
 }
 protected void Toggle(MeshAnimator animator, bool enabled)
 {
     if (animator != null)
     {
         if (this.EditMode == MeshAnimatorMultiplexerEditMode.Everything)
         {
             animator.gameObject.SetActive(true);
         }
         else
         {
             animator.gameObject.SetActive(enabled);
         }
     }
 }
 public void Stop(MeshAnimator animator, int frame)
 {
     this.Apply(
         animator,
         a => {
         this.Toggle(a, true);
         a.Stop(frame);
     },
         a => {
         this.Toggle(a, false);
         a.Stop();
     }
         );
 }
 public void Play(MeshAnimator animator)
 {
     this.Apply(
         animator,
         a => {
         this.Toggle(a, true);
         a.Play();
     },
         a => {
         this.Toggle(a, false);
         a.Stop();
     }
         );
 }
 public string GetKey(MeshAnimator animator)
 {
     return(this.Contains(animator) ? this.KeysByAnimator[animator] : null);
 }
        // ================================================================= //
        // Collection Methods
        // ================================================================= //

        public bool Contains(MeshAnimator animator)
        {
            this.Check();
            return(this.KeysByAnimator.ContainsKey(animator));
        }