public static RegionAttachment ToRegionAttachment(this Sprite sprite, string shaderName = "Spine/Skeleton") { var loader = new SpriteAttachmentLoader(sprite, Shader.Find(shaderName)); var att = loader.NewRegionAttachment(null, sprite.name, ""); loader = null; return(att); }
public void Attach() { var skeletonRenderer = GetComponent <SkeletonRenderer>(); if (loader == null) { //create loader instance, tell it what sprite and shader to use loader = new SpriteAttachmentLoader(sprite, Shader.Find("Spine/Skeleton")); } if (attachment == null) { attachment = loader.NewRegionAttachment(null, sprite.name, ""); } skeletonRenderer.skeleton.FindSlot(slot).Attachment = attachment; if (!keepLoaderInMemory) { loader = null; } }
public static RegionAttachment ToRegionAttachment(this Sprite sprite, string shaderName = "Spine/Skeleton") { var loader = new SpriteAttachmentLoader(sprite, Shader.Find(shaderName)); var att = loader.NewRegionAttachment(null, sprite.name, ""); loader = null; return att; }
public static RegionAttachment ToRegionAttachment(this Sprite sprite, string shaderName = "Spine/Skeleton") { SpriteAttachmentLoader spriteAttachmentLoader = new SpriteAttachmentLoader(sprite, Shader.Find(shaderName)); return(spriteAttachmentLoader.NewRegionAttachment(null, sprite.get_name(), string.Empty)); }