Ejemplo n.º 1
0
        public AvatarService.Request CombineParts(AvatarDefinition definition, BodyColorMaterialProperties bodycolor, List <ViewPart> parts, int maxAtlasDimension)
        {
            AvatarService.Request request = new AvatarService.Request();
            IEnumerator           value   = AvatarService.partsCombiner(request, definition, bodycolor ?? definition.BodyColor, parts, maxAtlasDimension);

            this.queue.Enqueue(new KeyValuePair <AvatarService.Request, IEnumerator>(request, value));
            return(request);
        }
Ejemplo n.º 2
0
 private static IEnumerator partsCombiner(AvatarService.Request request, AvatarDefinition definition, BodyColorMaterialProperties bodycolor, List <ViewPart> parts, int maxAtlasDimension)
 {
     AvatarService._partsCombiner_d__0 _partsCombiner_d__ = new AvatarService._partsCombiner_d__0(0);
     _partsCombiner_d__.request           = request;
     _partsCombiner_d__.definition        = definition;
     _partsCombiner_d__.bodycolor         = bodycolor;
     _partsCombiner_d__.parts             = parts;
     _partsCombiner_d__.maxAtlasDimension = maxAtlasDimension;
     return(_partsCombiner_d__);
 }
Ejemplo n.º 3
0
 protected override void cleanup()
 {
     meshDef.CleanUp(base.gameObject);
     ComponentExtensions.DestroyIfInstance(rend.sharedMaterial);
     rend.enabled = false;
     if (partsRequest != null)
     {
         outfitService.Unload(partsRequest);
         partsRequest = null;
     }
     if (decalsRequest != null)
     {
         outfitService.Unload(decalsRequest);
         decalsRequest = null;
     }
     combineRequest = null;
 }
Ejemplo n.º 4
0
 protected override void cleanup()
 {
     this.meshDef.CleanUp(base.gameObject);
     ComponentExtensions.DestroyIfInstance(this.rend.sharedMaterial);
     this.rend.enabled = false;
     if (this.partsRequest != null)
     {
         this.outfitService.Unload <EquipmentViewDefinition>(this.partsRequest);
         this.partsRequest = null;
     }
     if (this.decalsRequest != null)
     {
         this.outfitService.Unload <Texture2D>(this.decalsRequest);
         this.decalsRequest = null;
     }
     this.combineRequest = null;
 }
Ejemplo n.º 5
0
 public void Update()
 {
     if (combineRequest == null)
     {
         if (partsRequest != null && partsRequest.Finished && decalsRequest != null && decalsRequest.Finished)
         {
             BodyColorMaterialProperties bodycolor = new BodyColorMaterialProperties(Model.BeakColor, Model.BellyColor, Model.BodyColor);
             combineRequest = avatarService.CombineParts(Model.Definition, bodycolor, partViews, MaxAtlasDimension);
         }
     }
     else if (combineRequest.Finished)
     {
         setupRenderer();
         outfitService.Unload(partsRequest);
         partsRequest = null;
         outfitService.Unload(decalsRequest);
         decalsRequest  = null;
         combineRequest = null;
         stopWork();
     }
 }
Ejemplo n.º 6
0
 public void Update()
 {
     if (this.combineRequest == null)
     {
         if (this.partsRequest != null && this.partsRequest.Finished && this.decalsRequest != null && this.decalsRequest.Finished)
         {
             BodyColorMaterialProperties bodycolor = new BodyColorMaterialProperties(this.Model.BeakColor, this.Model.BellyColor, this.Model.BodyColor);
             this.combineRequest = this.avatarService.CombineParts(this.Model.Definition, bodycolor, this.partViews, this.MaxAtlasDimension);
         }
     }
     else if (this.combineRequest.Finished)
     {
         this.setupRenderer();
         this.outfitService.Unload <EquipmentViewDefinition>(this.partsRequest);
         this.partsRequest = null;
         this.outfitService.Unload <Texture2D>(this.decalsRequest);
         this.decalsRequest  = null;
         this.combineRequest = null;
         base.stopWork();
     }
 }