コード例 #1
0
 internal WorkerActor GetLifeActor(Type compType)
 {
     LifeDic.TryGetValue(compType, out var lifeActor);
     lock (LifeDic)
     {
         LifeDic.TryGetValue(compType, out lifeActor);
         if (lifeActor == null)
         {
             lifeActor         = new WorkerActor();
             LifeDic[compType] = lifeActor;
         }
     }
     return(lifeActor);
 }
コード例 #2
0
 static WorkerActor GetLifeActor(long actorId)
 {
     lifeActorDic.TryGetValue(actorId, out var actor);
     lock (lifeActorDic)
     {
         lifeActorDic.TryGetValue(actorId, out actor);
         if (actor == null)
         {
             actor = new WorkerActor();
             lifeActorDic[actorId] = actor;
         }
     }
     return(actor);
 }