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); }
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__); }
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; }
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; }
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(); } }
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(); } }