コード例 #1
0
ファイル: Bone.cs プロジェクト: BearishSun/BansheeEngine
        private void OnDestroy()
        {
            if (parent != null)
                parent.RemoveBone(this);

            parent = null;
        }
コード例 #2
0
ファイル: Bone.cs プロジェクト: BearishSun/BansheeEngine
        /// <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
ファイル: Bone.cs プロジェクト: BearishSun/BansheeEngine
        private void OnDisable()
        {
            if (parent != null)
                parent.RemoveBone(this);

            parent = null;
        }