UIKey.cs 1021 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. namespace XGame.Framework.UI
  3. {
  4. public class UIKey
  5. {
  6. public string Key { get; private set; }
  7. /// <summary>
  8. /// UIView的类型
  9. /// </summary>
  10. public Type UIViewType { get; private set; }
  11. /// <summary>
  12. /// FGUI的包名
  13. /// </summary>
  14. public string PackageName { get; private set; }
  15. /// <summary>
  16. /// FGUI的UI名字
  17. /// </summary>
  18. public string PanelName { get; private set; }
  19. public UIKey(string key, Type viewType)
  20. {
  21. Key = key;
  22. UIViewType = viewType;
  23. }
  24. public UIKey(string packageName, string panelName, Type viewType)
  25. {
  26. Key = $"{packageName}_{panelName}";
  27. UIViewType = viewType;
  28. PackageName = packageName ;
  29. PanelName = panelName ;
  30. }
  31. public static implicit operator string(UIKey uiKey) => uiKey.Key;
  32. public override string ToString() => Key;
  33. }
  34. }