mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[ts] Allow skeleton.setAttachment to accept null as attachmentName.
This commit is contained in:
parent
7f5502233f
commit
279e083baa
@ -407,7 +407,7 @@ export class Skeleton {
|
||||
/** A convenience method to set an attachment by finding the slot with {@link findSlot()}, finding the attachment with
|
||||
* {@link getAttachment()}, then setting the slot's {@link Slot.attachment}.
|
||||
* @param attachmentName May be null to clear the slot's attachment. */
|
||||
setAttachment (slotName: string, attachmentName: string) {
|
||||
setAttachment (slotName: string, attachmentName: string | null) {
|
||||
if (!slotName) throw new Error("slotName cannot be null.");
|
||||
const slot = this.findSlot(slotName);
|
||||
if (!slot) throw new Error(`Slot not found: ${slotName}`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user