Skip to content

Instantly share code, notes, and snippets.

@daichangxin
Created February 7, 2021 01:45
Show Gist options
  • Save daichangxin/e910206c4ab218471b4abc2b2f77d999 to your computer and use it in GitHub Desktop.
Save daichangxin/e910206c4ab218471b4abc2b2f77d999 to your computer and use it in GitHub Desktop.
export class FairySkinBase<T> extends fgui.GComponent {
$skin: T;
getChild(name: string): fgui.GObject {
return this.$skin[name] || super.getChild(name);
}
protected constructFromXML(xml: any) {
super.constructFromXML(xml);
this.$skin = FairyUtils.getMembersInfo(this) as any;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment