示例#1
0
        private void OnDestroy()
        {
            if (parent != null)
                parent.RemoveBone(this);

            parent = null;
        }
示例#2
0
        /// <summary>
        /// Changes the parent animation of this component.
        /// </summary>
        /// <param name="animation">New animation parent, can be null.</param>
        /// <param name="isInternal">If true the bone will just be changed internally, but parent animation will not be
        ///                          notified.</param>
        internal void SetParent(Animation animation, bool isInternal = false)
        {
            if (animation == parent)
                return;

            if (!isInternal)
            {
                if (parent != null)
                    parent.RemoveBone(this);

                if (animation != null)
                    animation.AddBone(this);
            }

            parent = animation;
        }
示例#3
0
        private void OnDisable()
        {
            if (parent != null)
                parent.RemoveBone(this);

            parent = null;
        }