public ActorProxy QueryActor(Graphics.Mesh.CGfxMesh mesh) { if (ValidActorPool.Count == 0) { for (int i = 0; i < 100; i++) { var ap = new ActorProxy(); ap.InitProxy(this); ValidActorPool.Enqueue(ap); } } var result = ValidActorPool.Dequeue(); result.SetShowMesh(CEngine.Instance.RenderContext.ImmCommandList, mesh); result.Checked = true; return(result); }