Advertisement
BorisKotlyar

Untitled

Jun 14th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.36 KB | None | 0 0
  1. using System;
  2. using Assets.Scripts.Wallet;
  3. using UnityEngine;
  4.  
  5. namespace Chests
  6. {
  7.     /// <summary>
  8.     /// Container for view element data (icons and e.t.c.)
  9.     /// </summary>
  10.     [Serializable]
  11.     public class VideoChestViewData
  12.     {
  13.         public string IconPath;
  14.         public Sprite GetIconSprite()
  15.         {
  16.             return Resources.Load<Sprite>(IconPath);
  17.         }
  18.     }
  19.  
  20.     /// <summary>
  21.     /// Chest repository for sub reward packs
  22.     /// </summary>
  23.     [Serializable]
  24.     public class VideoChestElement
  25.     {
  26.         [SerializeField] private VideoChestPack[] _packs;
  27.  
  28.         public VideoChestPack GetChestByChance()
  29.         {
  30.             return null; // add logic for chance randomizer
  31.         }
  32.     }
  33.  
  34.     /// <summary>
  35.     /// Reward pack repository, contains reward items
  36.     /// </summary>
  37.     [Serializable]
  38.     public class VideoChestPack
  39.     {
  40.         [SerializeField] private VideoChestItem[] _rewardItems;
  41.  
  42.         public float Chance;
  43.         public bool CalculateChance = true;
  44.  
  45.         public VideoChestItem GetPackByChance()
  46.         {
  47.             return null; // add logic for chance randomizer
  48.         }
  49.     }
  50.  
  51.     /// <summary>
  52.     /// Reward item
  53.     /// </summary>
  54.     [Serializable]
  55.     public class VideoChestItem
  56.     {
  57.         public CurrencyItem Item;
  58.         public float Chance;
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement