The engine waits for onLoad()
to be done before it adds the component to the update loop, so your code is the preferred way to do initialization of things that need to be loaded within components. So since update
won't be called on the component before onLoad()
has finished, your code should be safe without any extra checks inside of update
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…