LateUpdate¶
MainManager.LateUpdate is a very large update events, just like its Update counterpart. However, where it differs is Update is mainly concerned about inputs and UI naviguation updates while LateUpdate handles a lot of diverse update tasks. Most of its updates impacts visual with some state consistency logic. Most of the method requires basicload to be true meaning LoadEverything completed.
Here's what happens during LateUpdate:
messagebreak(the default linebreak of SetText mostly used in dialogue mode) is set 10.5 unless languageid is undefined or 0 (English) where it's 9.75 insteaditemdescbreak(the default linebreak of SetText mostly used when rendering items's description box) is set 9.9 unless languageid is undefined or 0 (English) where it's 10.5 insteadframestepis set to TieFramerate(1.0). This is a convenient, but partially out of date field to get number that scales with the smoothed average framerate based on 60 FPS (meaning 1.0 is equivalent to exactly 60 FPS). It's partially out of date because it's only updated on LateUpdate, but in practice, because TieFramerate is based on smoothDeltaTime, the variation should be minimal- At this point, the method returns abrutply if
basicloadis false which means LoadEverything isn't done yet - UpdateOutlines is called which sets the
GlobalOutlineglobal Shader float to the value that reflects the outlines setting GUICameraangles are reset to Vector3.zeroglobalcamdirhas its angles reset to (0.0,MainCameray angle, 0.0). For more information, check the camera system documentationglobalcooldowndecreases by TieFramerate(1.0)- If
playerdataisn't null or empty, RefreshHUD and RefreshDiscovery are called - If a
texttailexists, the tailtarget gets updated - If
startedis false (this is the first LateUpdate since boot) andplayerexists (meaning the game isn't loading a map), DetectIgnoreSphere is called onplayer.entityandstartedis set to true - If the game is
inevent, but notinbattle, bothletterboxelements has their color set to a lerp from the existing color to Color.black with a factor of TieFramerate(0.15) inputcooldownis decreased byframestep- If the
switchiconexists, its color is set to a lerp from the existing color to Color.clear with a factor of TieFramerate(0.01) stickholdxis updated such that it is true if the absolute value of InputIO.JoyStick(0) and InputIO.JoyStick(2) (the horizontal axises inputs) are below 0.5 indicating that neither axises have a held input on this framestickholdyis updated such that it is true if the absolute value of InputIO.JoyStick(1) and InputIO.JoyStick(3) (the vertical axises inputs) are below 0.5 indicating that neither axises have a held input on this frame- Some constraints on max numbers are enforced on 2 flagvar:
- 26 (berry bank balance): Set to 10000 if it is higher
- 27 (game token count): Set to 9999 if it is higher
- For any completed boardquests, they are removed from the open and taken boardquests
- If
partylevelis 27 (the max one),partyexpis set toneededexp(this essentially makes the EXP counter looks likeX/XwhereXwas theneededexpvalue set when rank 26 was reached)