当前位置: 首页>>代码示例>>C#>>正文


C# Skeleton.GetAttachment方法代码示例

本文整理汇总了C#中Spine.Skeleton.GetAttachment方法的典型用法代码示例。如果您正苦于以下问题:C# Skeleton.GetAttachment方法的具体用法?C# Skeleton.GetAttachment怎么用?C# Skeleton.GetAttachment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Spine.Skeleton的用法示例。


在下文中一共展示了Skeleton.GetAttachment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Apply

        public void Apply(Skeleton skeleton, float lastTime, float time, List<Event> firedEvents, float alpha)
        {
            float[] frames = this.frames;
            if (time < frames[0]) {
                if (lastTime > time) Apply(skeleton, lastTime, int.MaxValue, null, 0);
                return;
            } else if (lastTime > time) //
                lastTime = -1;

            int frameIndex = (time >= frames[frames.Length - 1] ? frames.Length : Animation.binarySearch(frames, time)) - 1;
            if (frames[frameIndex] < lastTime) return;

            String attachmentName = attachmentNames[frameIndex];
            skeleton.slots[slotIndex].Attachment =
                 attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
        }
开发者ID:xinwei2016,项目名称:test,代码行数:16,代码来源:Animation.cs

示例2: Apply

		public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList<Event> firedEvents, float alpha, bool setupPose, bool mixingOut) {
			string attachmentName;
			Slot slot = skeleton.slots.Items[slotIndex];
			if (mixingOut && setupPose) {
				attachmentName = slot.data.attachmentName;
				slot.Attachment = attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
				return;
			}

			float[] frames = this.frames;
			if (time < frames[0]) { // Time is before first frame.
				if (setupPose) {
					attachmentName = slot.data.attachmentName;
					slot.Attachment = attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
				}
				return;
			}

			int frameIndex;
			if (time >= frames[frames.Length - 1]) // Time is after last frame.
				frameIndex = frames.Length - 1;
			else
				frameIndex = Animation.BinarySearch(frames, time, 1) - 1;

			attachmentName = attachmentNames[frameIndex];
			slot.Attachment = attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
		}
开发者ID:EsotericSoftware,项目名称:spine-runtimes,代码行数:27,代码来源:Animation.cs

示例3: Apply

		public void Apply (Skeleton skeleton, float lastTime, float time, List<Event> firedEvents, float alpha) {
			float[] frames = this.frames;
			if (time < frames[0]) return; // Time is before first frame.

			int frameIndex;
			if (time >= frames[frames.Length - 1]) // Time is after last frame.
				frameIndex = frames.Length - 1;
			else
				frameIndex = Animation.binarySearch(frames, time, 1) - 1;

			String attachmentName = attachmentNames[frameIndex];
			skeleton.slots[slotIndex].Attachment =
				 attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
		}
开发者ID:D021,项目名称:ink,代码行数:14,代码来源:Animation.cs

示例4: Apply

		public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList<Event> firedEvents, float alpha) {
			float[] frames = this.frames;
			if (time < frames[0]) {
				if (lastTime > time) Apply(skeleton, lastTime, int.MaxValue, null, 0);
				return;
			} else if (lastTime > time) //
				lastTime = -1;

			int frameIndex = (time >= frames[frames.Length - 1] ? frames.Length : Animation.binarySearch(frames, time)) - 1;
//			if (frames[frameIndex] < lastTime) return;
            const float alphaThreshold = 0.5f; // don't set the attachment below 0.5 alpha.
            if (alpha < alphaThreshold) return;

            String attachmentName = attachmentNames[frameIndex];
			skeleton.slots.Items[slotIndex].Attachment =
				attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
		}
开发者ID:SirFelolis,项目名称:Snot-Ninja,代码行数:17,代码来源:Animation.cs


注:本文中的Spine.Skeleton.GetAttachment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。