File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ public static Task Init(Assembly assembly = null)
8484 if ( type . GetCustomAttribute ( typeof ( ComponentTypeAttribute ) ) is ComponentTypeAttribute compAttr )
8585 {
8686 var actorType = compAttr . Type ;
87- var compTypes = ActorComponentDic . GetOrAdd ( actorType ) ;
87+ var compTypes = ActorComponentDic . GetOrAddValue ( actorType ) ;
8888 compTypes . Add ( type ) ;
8989
9090 ComponentActorDic [ type ] = actorType ;
@@ -93,7 +93,7 @@ public static Task Init(Assembly assembly = null)
9393 {
9494 if ( type . GetCustomAttribute ( typeof ( FuncAttribute ) ) is FuncAttribute funcAttr )
9595 {
96- var set = FuncComponentDic . GetOrAdd ( funcAttr . Func ) ;
96+ var set = FuncComponentDic . GetOrAddValue ( funcAttr . Func ) ;
9797 set . Add ( type ) ;
9898 ComponentFuncDic [ type ] = funcAttr . Func ;
9999 }
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ private bool AddEvent(Type type)
358358 var compAgentType = type . BaseType . GetGenericArguments ( ) [ 0 ] ;
359359 var compType = compAgentType . BaseType . GetGenericArguments ( ) [ 0 ] ;
360360 var actorType = ComponentRegister . ComponentActorDic [ compType ] ;
361- var evtListenersDic = _actorEvtListeners . GetOrAdd ( actorType ) ;
361+ var evtListenersDic = _actorEvtListeners . GetOrAddValue ( actorType ) ;
362362
363363 var eventInfoAttributes = type . GetCustomAttributes < EventInfoAttribute > ( ) ;
364364 var infoAttributes = eventInfoAttributes . ToList ( ) ;
@@ -374,7 +374,7 @@ private bool AddEvent(Type type)
374374 }
375375
376376 var evtId = eventInfoAttribute . EventId ;
377- var listeners = evtListenersDic . GetOrAdd ( evtId ) ;
377+ var listeners = evtListenersDic . GetOrAddValue ( evtId ) ;
378378 listeners . Add ( ( IEventListener ) Activator . CreateInstance ( type ) ) ;
379379
380380 return true ;
You can’t perform that action at this time.
0 commit comments