Catalog
Allowed file types:jpg, jpeg, gif, png, webm, mp4, swf, pdfMax filesize is 8 MB.Max image dimensions are 10000 x 10000. You may upload 5 per post.
File: 1457029133035.jpg (37.88 KB, 500x333, 500:333, Nigel-the-British-Parrot-M….jpg)
Nodev 03/03/16 (Thu) 18:18:52 d02ffc No.25833
how does unity knows that a monobehaviour sub class implements Update() or not?
i mean i know how to do that with virtual methods, abstract class and interfaces, but unity behave in different ways if there are particular methods or not. and the code is way better in the way unity does that.
Nodev 03/04/16 (Fri) 15:11:55 124636 No.25845
I don't know about unity but .net has reflection.
Nodev 03/04/16 (Fri) 15:42:24 7aae16 No.25846
o yes, no i see how he does that (propably)
trough reflection, in the standard costructor, it binds every event in the base class to every method with the same name in the derived class.
i'm not sure if this is better than regular inheritance
Nodev 03/04/16 (Fri) 16:22:41 124636 No.25847
>>25846
>i'm not sure if this is better than regular inheritance
As general statement I say no.
Nodev 03/10/16 (Thu) 22:43:24 dd0625 No.25954
A bug I had recently was I had a method marked as 'new' rather than 'override', so when I called methodName() on its base class, the 'new' method didn't get fired.
I guess I don't understand what 'new' methods would be useful for.