private void renderRewardItem(long requestId, DCustomEquipment customEquipment) { itemImageBuilder = ItemImageBuilder.acquire(); try { AbstractImageBuilder.CallbackToken callbackToken = default(AbstractImageBuilder.CallbackToken); callbackToken.Id = requestId; callbackToken.DefinitionId = customEquipment.DefinitionId; itemImageBuilder.RequestImage(customEquipment, delegate(bool success, Texture2D texture, AbstractImageBuilder.CallbackToken token) { if (success) { onIconReady(texture); } else { cleanupItemImageBuilder(); } }, callbackToken, itemIconBackgroundColor, itemIconPenguinColor); } catch (Exception ex) { Log.LogException(this, ex); cleanupItemImageBuilder(); } }
protected virtual void Start() { Service.Get <EventDispatcher>().DispatchEvent(new AwayFromKeyboardEvent(AwayFromKeyboardStateType.Marketplace)); getLatestInventory(); ItemImageBuilder.acquire(); start(); }
private void cleanupItemImageBuilder() { if (itemImageBuilder != null) { ItemImageBuilder.release(); itemImageBuilder = null; } }
protected virtual void OnDestroy() { if (itemImageBuilderInstance != null) { ItemImageBuilder.release(); itemImageBuilderInstance = null; } }
private void OnDisable() { if (itemImageBuilder != null) { ItemImageBuilder.release(); itemImageBuilder = null; } }
public static void release() { if (--refCount <= 0) { instance.destroy(); instance = null; } }
private void OnDestroy() { ItemImageBuilder.release(); if (rewardRenderer != null) { CoroutineRunner.StopAllForOwner(rewardRenderer); } }
public static ItemImageBuilder acquire() { if (instance == null) { instance = new ItemImageBuilder(); } refCount++; return(instance); }
private void onEquipmentInstanceLoaded(bool success, Texture2D texture, AbstractImageBuilder.CallbackToken callbackToken) { if (success && reward.EquipmentRequest.equipmentId == callbackToken.Id && reward.EquipmentRequest.definitionId == callbackToken.DefinitionId) { callback(Sprite.Create(texture, new Rect(0f, 0f, texture.width, texture.height), Vector2.zero), null); } if (itemImageBuilder != null) { ItemImageBuilder.release(); itemImageBuilder = null; } }
public void ShowChest(Reward chestReward, CellPhoneDailySpinActivityDefinition widgetData, DailySpinEntityData spinData, CellPhoneDailySpinActivityDefinition.ChestDefinition currentChestDefinition, bool gotNewChest) { this.chestReward = chestReward; this.widgetData = widgetData; this.spinData = spinData; this.currentChestDefinition = currentChestDefinition; this.gotNewChest = gotNewChest; ChestSpriteSelector.SelectSprite(currentChestDefinition.ChestId); localizer = Service.Get <Localizer>(); SetState(RewardScreenState.ChestUnlocked); base.gameObject.SetActive(value: true); itemImageBuilder = ItemImageBuilder.acquire(); Content.LoadAsync(onRewardItemLoaded, RewardItemKey); }
public void Init(InventoryEquipmentModel model) { this.model = model; templateDefinitions = Service.Get <GameData>().Get <Dictionary <int, TemplateDefinition> >(); scrollRect = editableItemController.GetComponentInChildren <ScrollRect>(); itemImageBuilder = ItemImageBuilder.acquire(); categoryController = new InventoryCategoryController(); categoryController.Init(model, categoryManager); InventoryContext.EventBus.DispatchEvent(default(ClothingDesignerUIEvents.ShowAllTemplates)); setupListeners(); editableItemController.gameObject.SetActive(value: true); int size = model.DisplayedInventory.Count + 2; editableItemController.CreateEditableItemList(inventoryPrefabContentKey, size); IsInitialized = true; }
private void OnDestroy() { if (eventChannel != null) { eventChannel.RemoveAllListeners(); } if (mainEventChannel != null) { mainEventChannel.RemoveAllListeners(); } if (model != null) { model.Destroy(); } if (itemImageBuilder != null) { ItemImageBuilder.release(); } if (categoryController != null) { categoryController.Destroy(); } }
private void OnDisable() { ItemImageBuilder.release(); }
private void Awake() { IconImage.color = Color.clear; ItemImageBuilder.acquire(); }
protected override void onDestroy() { base.onDestroy(); ItemImageBuilder.release(); }
private void renderClothingInstance() { itemImageBuilder = ItemImageBuilder.acquire(); itemImageBuilder.RequestImage(CustomEquipmentResponseAdaptor.ConvertResponseToCustomEquipment(reward.EquipmentRequest), onEquipmentInstanceLoaded); }
protected override void awake() { base.awake(); ItemImageBuilder.acquire(); }
private void OnEnable() { ItemImageBuilder.acquire(); }
protected virtual void OnDestroy() { Service.Get <EventDispatcher>().DispatchEvent(new AwayFromKeyboardEvent(AwayFromKeyboardStateType.Here)); ItemImageBuilder.release(); onDestroy(); }
protected virtual void OnDestroy() { this.ScreenCompleteAction = null; ItemImageBuilder.release(); }
private void Awake() { ItemImageBuilder.acquire(); }