07-23-2021, 12:28 PM
Hi again.
1- After digging in this subject, I see that ScanConnections is not set to be executed every frame. It is supposed to execute only when the hierarchy changes. Does your hierarchy change every frame?
2- I tested with 20k cubes, and ScanConnections did not show any significant CPU usage. Maybe it is because your game objects are way more complex?
3- Here is an optimization to ScanConnections:
replace
CurvyConnection[] o = GameObject.FindObjectsOfType<CurvyConnection>();
with
CurvyConnection[] o = CurvyGlobalManager.Instance.GetComponentsInChildren<CurvyConnection>();
Since I couldn't reproduce the issue, I wasn't able to test how efficient this optimization is, but it is theoretically efficient. Can you please apply it on your project and tell me what was the result? Thanks
1- After digging in this subject, I see that ScanConnections is not set to be executed every frame. It is supposed to execute only when the hierarchy changes. Does your hierarchy change every frame?
2- I tested with 20k cubes, and ScanConnections did not show any significant CPU usage. Maybe it is because your game objects are way more complex?
3- Here is an optimization to ScanConnections:
replace
CurvyConnection[] o = GameObject.FindObjectsOfType<CurvyConnection>();
with
CurvyConnection[] o = CurvyGlobalManager.Instance.GetComponentsInChildren<CurvyConnection>();
Since I couldn't reproduce the issue, I wasn't able to test how efficient this optimization is, but it is theoretically efficient. Can you please apply it on your project and tell me what was the result? Thanks
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.