Пример #1
0
        private void SortIkConstraint(IkConstraint constraint)
        {
            Bone target = constraint.target;

            SortBone(target);

            var  constrained = constraint.bones;
            Bone parent      = constrained.Items[0];

            SortBone(parent);

            if (constrained.Count > 1)
            {
                Bone child = constrained.Items[constrained.Count - 1];
                if (!updateCache.Contains(child))
                {
                    updateCacheReset.Add(child);
                }
            }

            updateCache.Add(constraint);

            SortReset(parent.children);
            constrained.Items[constrained.Count - 1].sorted = true;
        }
Пример #2
0
        private void SortIkConstraint(IkConstraint constraint)
        {
            constraint.active = constraint.target.active &&
                                (!constraint.data.skinRequired || (skin != null && skin.constraints.Contains(constraint.data)));
            if (!constraint.active)
            {
                return;
            }

            Bone target = constraint.target;

            SortBone(target);

            var  constrained = constraint.bones;
            Bone parent      = constrained.Items[0];

            SortBone(parent);

            if (constrained.Count > 1)
            {
                Bone child = constrained.Items[constrained.Count - 1];
                if (!updateCache.Contains(child))
                {
                    updateCacheReset.Add(child);
                }
            }

            updateCache.Add(constraint);

            SortReset(parent.children);
            constrained.Items[constrained.Count - 1].sorted = true;
        }
Пример #3
0
        private void SortIkConstraint(IkConstraint constraint)
        {
            Bone target = constraint.target;

            SortBone(target);
            ExposedList <Bone> exposedList = constraint.bones;
            Bone bone = exposedList.Items[0];

            SortBone(bone);
            if (exposedList.Count > 1)
            {
                Bone item = exposedList.Items[exposedList.Count - 1];
                if (!updateCache.Contains(item))
                {
                    updateCacheReset.Add(item);
                }
            }
            updateCache.Add(constraint);
            SortReset(bone.children);
            exposedList.Items[exposedList.Count - 1].sorted = true;
        }
 static int Contains(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Spine.ExposedList <Spine.Animation> obj = (Spine.ExposedList <Spine.Animation>)ToLua.CheckObject <Spine.ExposedList <Spine.Animation> >(L, 1);
         Spine.Animation arg0 = (Spine.Animation)ToLua.CheckObject <Spine.Animation>(L, 2);
         bool            o    = obj.Contains(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #5
0
        // --- Animations.
        /// <returns>May be null.</returns>
        public Animation FindAnimation(String animationName)
        {
            if (animationName == null)
            {
                throw new ArgumentNullException("animationName", "animationName cannot be null.");
            }
            ExposedList <Animation> animations = this.animations;

            for (int i = 0, n = animations.Count; i < n; i++)
            {
                Animation animation = animations.Items[i];
                if (animation.name == animationName)
                {
                    return(animation);
                }
            }

            if (AnimationNames.Contains(animationName))
            {
                //Load ???
                string    _path  = string.Format("{0}/{1}", animPath, animationName);
                TextAsset _asset = null;
                _asset = AssetBundleManager.Instance.InstantiatePrefab <TextAsset>(_path); // 临时资源包,5秒后释放

                //LoadPoolMgr._.Load<TextAsset>(_path, CacheType.Temporary);//Resources.Load(_path) as TextAsset;
                Animation _ani = null;
                if (_asset == null)
                {
                    return(_ani);
                }
                using (MemoryStream _input = new MemoryStream(_asset.bytes))
                {
                    _ani = SkeletonBinary_Xiimoon.ReadAnimation(animationName, _input, this);
                    _input.Close();
                    _input.Dispose();
                }
                _asset = null;
                return(_ani);
            }

            return(null);
        }