File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
MLAPI/MonoBehaviours/Core Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -413,7 +413,29 @@ private ulong HashMethodName(string name)
413
413
414
414
return 0 ;
415
415
}
416
-
416
+
417
+ private MethodInfo [ ] GetNetworkedBehaviorChildClassesMethods ( Type type , List < MethodInfo > list = null )
418
+ {
419
+ if ( list == null )
420
+ {
421
+ list = new List < MethodInfo > ( ) ;
422
+ list . AddRange ( type . GetMethods ( BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance ) ) ;
423
+ }
424
+ else
425
+ {
426
+ list . AddRange ( type . GetMethods ( BindingFlags . NonPublic | BindingFlags . Instance ) ) ;
427
+ }
428
+
429
+ if ( type . BaseType != null && type . BaseType != typeof ( NetworkedBehaviour ) )
430
+ {
431
+ return GetNetworkedBehaviorChildClassesMethods ( type . BaseType , list ) ;
432
+ }
433
+ else
434
+ {
435
+ return list . ToArray ( ) ;
436
+ }
437
+ }
438
+
417
439
private void CacheAttributes ( )
418
440
{
419
441
Type type = GetType ( ) ;
@@ -425,7 +447,7 @@ private void CacheAttributes()
425
447
if ( Methods . ContainsKey ( type ) ) methods = Methods [ type ] ;
426
448
else
427
449
{
428
- methods = type . GetMethods ( BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance ) ;
450
+ methods = GetNetworkedBehaviorChildClassesMethods ( type ) ;
429
451
Methods . Add ( type , methods ) ;
430
452
}
431
453
You can’t perform that action at this time.
0 commit comments