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);
        }
Esempio n. 2
0
 public PlayerPropertiesContext(PropertiesEnum type, float value, string textPath) : base(type, value)
 {
     if (textPath != null)
     {
         Text = GameObject.Find(textPath).GetComponent <Text>();
         UpdateText();
     }
 }
Esempio n. 3
0
    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());
            }
        }
Esempio n. 5
0
    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("详细请查看代码");
    }
Esempio n. 6
0
 // PropertiesEnum
 public void AddPropertie(PropertiesEnum type)
 {
     _attributeDictionary[type].Value += 1;
     _attributeDictionary[type].UpdateText();
 }
Esempio n. 7
0
 // Getter functions
 public float GetPropertie(PropertiesEnum type)
 {
     return(_attributeDictionary[type].Value);
 }
Esempio n. 8
0
 public PropertiesContext(PropertiesEnum type, float value)
 {
     Type  = type;
     Value = value;
 }