コード例 #1
0
 /// <summary>
 /// Initialize this unbought decor object.
 /// </summary>
 /// <param name="decorAd">The item to initialize this decor item with.</param>
 public void Initialize(DecorAds decorAd)
 {
     // Set this unbought decor object's sprite and text, before storing a reference to the decor item
     // this item is storing.
     SetImage(decorAd.GetSprite());
     SetText(decorAd.ToTitleCaseSpacedString());
     this.decorItem = decorAd;
 }
コード例 #2
0
        /// <summary>
        /// Load and return the sprite representing the provided ad <paramref name="decorAd"/>.
        /// </summary>
        /// <param name="decorAd">The ad whose sprite to return.</param>
        /// <returns>the sprite representing the provided ad <paramref name="decorAd"/>.</returns>
        public static Sprite GetSprite(this DecorAds decorAd)
        {
            string decorAdAsString = decorAd.ToCamelCaseString();

            return(Resources.Load <Sprite>("Sprites/DecorSprites/" + decorAdAsString));
        }