03-18-2016, 04:23 PM
(This post was last modified: 03-18-2016, 04:25 PM by Trainzland.)
(03-17-2016, 01:03 PM)Nalle Wrote: To remove the update calls I've wrapped the three update methods in CurvySpline.cs in a conditional define so that they are only run in the Unity editor (i.e. #if UNITY_EDITOR). On scene load I then manually call update on each spline a single time to initialize them which allows the SplineController to navigate the spline network.
I used a similar work around on CurvySpline.cs.
Additionally: This make sure the SplineControllers start to work
Code:
void Start() {
doUpdate();
}
}
Each of the UpdateXX Method includes:.
Code:
void Update() {
(!CheckTransform ) return;
........
}
Disabling CheckTransform on any spline separately eliminates the CPU overhead drastically.
But this is not all btw. The CurvyConnection Update() cause another trouble on my configuration because of the Update() method too.
Code:
public void Update() {
bool syncPos = TTransform.position != transform.position;
bool syncRot = TTransform.rotation != transform.rotation;
if (syncPos || syncRot) {
SynchronizeINTERNAL(transform);
}
}
This seems, it's used to hold the connection points over each other. Therefore I wrote about "permanently animated feature". All this required updates methods are use to perform changes or animations if they eventually used. If using some splines only, it doesn't matter. Try to use #if UNITY_EDITOR on CurvyConnection.Udpate() Perhaps this change the call stack resizement for the Build previously.
(Henry Ford) Each hour more of searching is each hour less of your live time.