public static Material Get(EMaterialType type) { if (m_instance.m_dic.ContainsKey((int)type)) { return(m_instance.m_dic[(int)type]); } return(null); }
private T Add <T>(string _name, int _tileIndex, int _level, EMaterialType _materialType = EMaterialType.METAL, bool _isArtifact = false) where T : XObject, IResourceEssence { var result = m_helperGenerator.CreateXResourceEssence <T>(m_types[typeof(T)]); result.Name = _name; result.TileIndex = _tileIndex; result.IsArtifact = _isArtifact; result.Level = _level; result.MaterialTypes = _materialType; return(result); }
private static IEnumerable <EMaterialType> GetAllowedMaterialTypes(EMaterialType _materialsType) { var allowedMaterials = (from EMaterialType value in Enum.GetValues(typeof(EMaterialType)) where _materialsType.HasFlag(value) select value).ToArray(); return(allowedMaterials); }