public static string GetProperty(string filePath, PropertiesEnum property) { var folder = new Shell32.Shell().NameSpace(Path.GetDirectoryName(filePath)); var item = folder.ParseName(Path.GetFileName(filePath)); var fixed_Data = RemoveMiscChar(folder.GetDetailsOf(item, (int)property)); return(fixed_Data); }
public PlayerPropertiesContext(PropertiesEnum type, float value, string textPath) : base(type, value) { if (textPath != null) { Text = GameObject.Find(textPath).GetComponent <Text>(); UpdateText(); } }
public void AddTempNumber(PropertiesEnum type) { switch (type) { case PropertiesEnum.RestoreHP: _tempHP += _attributeDictionary[PropertiesEnum.RestoreHP].Value; break; default: break; } }
public static TimeSpan GetTimeSpanProperty(string filePath, PropertiesEnum property) { var folder = new Shell32.Shell().NameSpace(Path.GetDirectoryName(filePath)); var item = folder.ParseName(Path.GetFileName(filePath)); var fixed_Data = RemoveMiscChar(folder.GetDetailsOf(item, (int)property)); if (!string.IsNullOrWhiteSpace(fixed_Data)) { return(TimeSpan.Parse(fixed_Data)); } else { return(new TimeSpan()); } }
public void OnGUI() { GUILayout.Label("以下描述从Enum中读取显示"); var max = Enum.GetValues(typeof(PropertiesEnum)).Length; //从1开始 for (int idx = 1; idx <= max; idx++) { PropertiesEnum _enum = (PropertiesEnum)idx; var desc = PropertiesUtils.GetDescByType(_enum); if (GUILayout.Button(desc)) { Debug.Log(string.Format(desc)); } } GUILayout.Label("详细请查看代码"); }
// PropertiesEnum public void AddPropertie(PropertiesEnum type) { _attributeDictionary[type].Value += 1; _attributeDictionary[type].UpdateText(); }
// Getter functions public float GetPropertie(PropertiesEnum type) { return(_attributeDictionary[type].Value); }
public PropertiesContext(PropertiesEnum type, float value) { Type = type; Value = value; }