Created
February 7, 2021 01:41
-
-
Save daichangxin/6d509e08d67fe2603656d59d329a1549 to your computer and use it in GitHub Desktop.
覆盖fairygui的getChild方法,提高性能
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 初始化Fairygui时调用 | |
const rawNewObject = fgui.UIObjectFactory.newObject; | |
fgui.UIObjectFactory.newObject = (pi: fgui.PackageItem): fgui.GObject => { | |
if (!pi.extensionType && pi.objectType === fgui.ObjectType.Component) { | |
const skin = new FairySkinBase(); | |
skin.packageItem = pi; | |
return skin; | |
} | |
return rawNewObject(pi); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment