Example #1
0
        private IEnumerator renderFurnitureTemplate(string unlockID)
        {
            Texture2DContentKey iconContentKey = EquipmentPathUtil.GetFurnitureIconPath(unlockID);

            if (!Content.ContainsKey(iconContentKey.Key))
            {
                iconContentKey = RewardPopupConstants.DefaultIconContentKey;
            }
            AssetRequest <Texture2D> assetRequest = Content.LoadAsync(iconContentKey);

            yield return(assetRequest);

            callback(Sprite.Create(assetRequest.Asset, new Rect(0f, 0f, assetRequest.Asset.width, assetRequest.Asset.height), Vector2.zero), null);
        }
Example #2
0
 private void populateIconsForCategory(FurnitureTemplateCategory category)
 {
     if (category != 0)
     {
         if (!rawTemplateData.TryGetValue(category, out var value))
         {
             Log.LogError(this, "Data does not contain key for current category: " + category);
         }
         for (int i = 0; i < value.Length; i++)
         {
             Texture2DContentKey furnitureIconPath = EquipmentPathUtil.GetFurnitureIconPath(value[i]);
             Content.LoadAsync(onTemplateIconTexLoaded, furnitureIconPath);
         }
     }
 }