public static MaterialType GetPrevMaterial(this MaterialType type) { int i = type.GetInt() - 1; if (i < 0) { return(type); } return(i.ToMaterialType()); }
public static MaterialType GetNextMaterial(this MaterialType type) { int i = type.GetInt() + 1; if (i >= MaterialType.Total.GetInt()) { return(type); } return(i.ToMaterialType()); }