當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。