示例#1
0
 public MaterialInfo(int id)
 {
     material = MaterialModule.GetMaterialByMaterialID(id);
     if (material != null)
     {
         ID        = id;
         dataModel = new MaterialDataModel();
         dataModel.Create(ID);
         mainType = MaterialModule.GetMaterialType(id);
         subType  = MaterialModule.GetMaterialSubType(id);
     }
 }
示例#2
0
 public override void Construction()
 {
     AllMaterialList = new List <Material>();
     for (int i = 0; i < 2; i++)
     {
         Material mat = new Material();
         mat.MaterialID    = i;
         mat.MaterialName  = "";
         mat.NameEn        = "";
         mat.MaterialDesc  = "";
         mat.Type          = "";
         mat.SubType       = "";
         mat.BlockCapacity = (ushort)i;
         mat.PriceBase     = i;
         mat.MaterialIcon  = "";
         mat.BG            = "";
         mat.UnitName      = "";
         mat.Rarity        = (ushort)i;
         mat.ModelPath     = "";
         AllMaterialList.Add(mat);
     }
     AllMaterialTypeList = new List <MaterialType>();
     for (int i = 0; i < 2; i++)
     {
         MaterialType type = new MaterialType();
         type.Type        = "";
         type.DefaultShow = true;
         type.TypeName    = "";
         type.TypeDesc    = "";
         type.TypeIcon    = "";
         type.SubTypeList = "";
         AllMaterialTypeList.Add(type);
     }
     AllMaterialSubTypeList = new List <MaterialSubType>();
     for (int i = 0; i < 2; i++)
     {
         MaterialSubType type = new MaterialSubType();
         type.SubType     = "";
         type.DefaultShow = true;
         type.TypeName    = "";
         type.TypeDesc    = "";
         type.TypeIcon    = "";
         AllMaterialSubTypeList.Add(type);
     }
 }
示例#3
0
 public static Sprite GetMaterialSubTypeIcon(MaterialSubType subtype)
 {
     return(Utility.LoadSprite(subtype.TypeIcon));
 }
示例#4
0
 public static string GetMaterialSubTypeDesc(MaterialSubType subtype)
 {
     return(MultiLanguage.Instance.GetTextValue(subtype.TypeDesc));
 }
示例#5
0
 public void InitSubTag(MaterialSubType type)
 {
     icon.sprite = MaterialModule.GetMaterialSubTypeIcon(type);
     Name.text   = MaterialModule.GetMaterialSubTypeName(type);
     subType     = type;
 }