perf: cache hot-path lookups + throttle LegCorrector raycasts #32
No reviewers
Labels
No labels
architecture
bug
duplicate
enhancement
help wanted
invalid
performance
quality
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lavarius/ProjectOverlay!32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/perf-issues"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #10, #11, #12, #13
Changes
#10 — CharacterStore
GetComponent<Animator>in LateUpdateDictionary<GameObject, Animator> _animatorByModelpopulated once inAwake()LayerMask.NameToLayer("Character")as_characterLayerLateUpdateandSwapModelnow use the dictionary — zeroGetComponentcalls at runtime#11 — AddCameraToStack
MainCameraInstance.Instanceevery frame_mainCameraInstance(was leaking as[SerializeField])Start(), LateUpdate only retries while null#12 — MovementManager
Camera.mainin LateUpdateStart()already handles the null-safe cache#13 — LegCorrector 6 raycasts/frame
Vector3[]arrays for foot points cached as class fields (no per-frame allocation)raycastFrameIntervalframes (default 3, tunable in Inspector)