Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
StaticAssetAttribute.cs
Go to the documentation of this file.
1 using System;
2 using Microsoft.Xna.Framework.Graphics;
3 
4 namespace Loot.Api.Attributes
5 {
6  [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
7  internal sealed class StaticAssetAttribute : Attribute
8  {
9  public readonly string AssetPath;
10 
11  public StaticAssetAttribute(string _path)
12  {
13  AssetPath = _path;
14  }
15 
16  public Texture2D LoadTexture2D()
17  {
18  string path = AssetPath;
19  if (path.StartsWith("Loot/"))
20  path = path.Replace("Loot/", "");
21  return Loot.Instance.GetTexture(path);
22  }
23  }
24 }