|
Hi, everyone, I was just wondering if there was a way to achieve a LateFixedUpdate() function effect, because I am trying to stay with fixed update for my game, and I need a late update function. All help is appreciated!!! :)
(comments are locked)
|
|
Here's an idea: I do this with all my code. This is a little confusing if you don't program, but it is actually faster than having lots of Update() calls.
Here is a sample:
This will create 2 events. Then you can have classes register to them.
By the way, if someone more knowledgeable than myself can tell me that my understanding of Unity's threading is completely wrong then please do ;). EDIT: I managed to get it working with javascript. The first code needs to be in C# because I don't believe you can do events in javascript. But the second code can be in js with the following syntax: Your understanding of Unity's threading is completely wrong! ^.^ nah it looks good :)
Apr 22 '11 at 12:27 AM
Joshua
Peter G, thank you so much, but would it be possible to get that code in js? if not, thats ok, seeing as some things cannot be done in js, but it would be nice to get it.
Apr 22 '11 at 01:11 AM
zmar0519
Oh, another trick you can do. Create an interface that has these methods. Then have algorithm in your 1st script that finds instances of all classes that implement that interface. foreach(MonoBehaviour mB in the scene) { if( mB is IEventManager) { //add to list } }
Apr 22 '11 at 02:30 AM
Peter G
(comments are locked)
|

I edited my post