阅读背景:

unity spine动态换肤_kb1181的专栏_spine换肤

来源:互联网 

在unity导入spine后,spine中是有一个换肤的函数的

        public void SetSkin(Skin newSkin) {
			if (newSkin == skin)return;
			if (newSkin != null) {
				if (skin != null)
					newSkin.AttachAll(this, skin);
				else {
					ExposedList<Slot> slots = this.slots;
					for (int i = 0, n = slots.Count; i < n; i++) {
						Slot slot = slots.Items[i];
						string name = slot.data.attachmentName;
						if (name != null) {
							Attachment attachment = newSkin.GetAttachment(i, name);
							if (attachment != null)slot.Attachment = attachment;
						}
					}
				}
			}
			skin = newSkin;
			UpdateCache();
		}        publi



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: