SysDefine.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /***
  2. *
  3. * Title: "SUIFW" UI框架项目
  4. * 主题: 框架本身系统核心参数定义集
  5. * Description:
  6. * 功能: 提供本框架范围内的如下系统定义:
  7. * 1:系统常量。
  8. * 2:全局性变量
  9. * 3:系统枚举
  10. * 4:委托定义
  11. * 5:框架接口
  12. *
  13. * Date: 2017
  14. * Version: 0.1版本
  15. * Modify Recoder:
  16. *
  17. *
  18. */
  19. using UnityEngine;
  20. using UnityEngine.UI;
  21. using System;
  22. using System.Collections.Generic;
  23. namespace SUIFW
  24. {
  25. #region 系统枚举
  26. /// <summary>
  27. /// UI窗体类型
  28. /// </summary>
  29. public enum UIFormsType
  30. {
  31. Normal, // 普通全屏界面(例如主城UI界面)
  32. Fixed, // 固定界面(例如“英雄信息条” [HeroTopBar])
  33. PopUp, // 弹出模式(小窗口)窗口 (例如:商场、背包、确认窗口等)
  34. }
  35. /// <summary>
  36. /// UI窗体显示类型
  37. /// </summary>
  38. public enum UIFormsShowMode
  39. {
  40. Normal, //普通显示
  41. ReverseChange, //反向切换
  42. HideOther, //隐藏其他界面
  43. }
  44. /// <summary>
  45. /// UI窗体透明度类型
  46. /// </summary>
  47. public enum UIFormsLucencyType
  48. {
  49. Lucency, //完全透明,但不能穿透。
  50. Translucence, //半透明度,不能穿透。
  51. Impenetrable, //低透明度,不能穿透,
  52. Penetrate, //可以穿透
  53. }
  54. #endregion
  55. /// <summary>
  56. /// 系统定义静态类
  57. /// </summary>
  58. internal static class SysDefine
  59. {
  60. #region 系统常量
  61. /* 路径常量 */
  62. public const string SYS_PATH_CANVAS = "Canvas";
  63. public const string SYS_PATH_CNLauguageJson = "LauguageJSONConfig";
  64. public const string SYS_PATH_SysConfigJson = "SysConfigInfo";
  65. public const string SYS_PATH_UIFormConfigJson = "UIFormsConfigInfo";
  66. /* 标签常量 */
  67. public const string SYS_TAG_CANVAS = "_TagCanvas";
  68. public const string SYS_TAG_UICAMERA = "_TagUICamera";
  69. /* Canvas节点名称 */
  70. public const string SYS_CANVAS_NORMAL_NODE_NAME = "Normal";
  71. public const string SYS_CANVAS_FIXED_NODE_NAME = "Fixed";
  72. public const string SYS_CANVAS_POPUP_NODE_NAME = "PopUp";
  73. public const string SYS_CANVAS_UISCRIPTS_NODE_NAME = "_UIScripts";
  74. public const string SYS_CANVAS_UIMASKPANELS_NODE_NAME = "UIMaskPanels";
  75. /* 遮罩管理器常量 */
  76. //完全透明度
  77. public const float SYS_UIMASK_LUCENCY_COLOR_RGB = 255F / 255F;
  78. public const float SYS_UIMASK_LUCENCY_COLOR_A = 0F / 255F;
  79. //半透明度
  80. public const float SYS_UIMASK_TRANSLUCENCY_COLOR_RGB = 220F / 255F;
  81. public const float SYS_UIMASK_TRANSLUCENCY_COLOR_A = 50F / 255F;
  82. //低透明度
  83. public const float SYS_UIMASK_IMPENETRABLE_COLOR_RGB = 0F / 255F;
  84. public const float SYS_UIMASK_IMPENETRABLE_COLOR_A = 235F / 255F;
  85. /// <summary>
  86. /// UI摄像机,层深增加量
  87. /// </summary>
  88. public const int SYS_UICAMERA_DEPTH_INCREMENT = 100;
  89. #endregion
  90. #region 全局性变量(方法)
  91. //得到日志配置文件(XML)路径
  92. public static string GetLogPath()
  93. {
  94. string logPath = null;
  95. //Android 或者Iphone 环境
  96. if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
  97. {
  98. logPath = Application.streamingAssetsPath + "/LogConfigInfo.xml";
  99. }
  100. //Win环境
  101. else
  102. {
  103. logPath = "file://" + Application.streamingAssetsPath + "/LogConfigInfo.xml";
  104. }
  105. return logPath;
  106. }
  107. //得到日志配置文件(XML)根节点名称
  108. public static string GetLogRootNodeName()
  109. {
  110. string strReturnXMLRootNodeName = null;
  111. strReturnXMLRootNodeName = "SystemConfigInfo";
  112. return strReturnXMLRootNodeName;
  113. }
  114. //得到"UI窗体预设"配置文件(XML)路径
  115. public static string GetUIFormsConfigFilePath()
  116. {
  117. string logPath = null;
  118. //Android 或者Iphone 环境
  119. if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
  120. {
  121. logPath = Application.streamingAssetsPath + "/UIFormsConfigInfo.xml";
  122. }
  123. //Win环境
  124. else
  125. {
  126. logPath = "file://" + Application.streamingAssetsPath + "/UIFormsConfigInfo.xml";
  127. }
  128. return logPath;
  129. }
  130. //得到"UI窗体预设"配置文件(XML)的根节点名称
  131. public static string GetUIFormsConfigFileRootNodeName()
  132. {
  133. string strReturnXMLRootNodeName = null;
  134. strReturnXMLRootNodeName = "UIFormsConfigInfo";
  135. return strReturnXMLRootNodeName;
  136. }
  137. /* 由于使用Json 技术解析大量中文信息,所以不用本xml 路径了 */
  138. //得到"UI窗体预设"配置文件(XML)路径
  139. //public static string GetLauguageConfigFilePath()
  140. //{
  141. // string logPath = null;
  142. // //Android 或者Iphone 环境
  143. // if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
  144. // {
  145. // logPath = Application.streamingAssetsPath + "/ChineseLauguageConfigData.xml";
  146. // }
  147. // //Win环境
  148. // else
  149. // {
  150. // logPath = "file://" + Application.streamingAssetsPath + "/ChineseLauguageConfigData.xml";
  151. // }
  152. // return logPath;
  153. //}
  154. ////得到“中文XML”配置文件根节点名称
  155. //public static string GetLauguageConfigFileRootNodeName()
  156. //{
  157. // string strReturnXMLRootNodeName = null;
  158. // strReturnXMLRootNodeName = "ChineseConfigData";
  159. // return strReturnXMLRootNodeName;
  160. //}
  161. #endregion
  162. #region 委托定义
  163. #endregion
  164. #region 框架接口
  165. #endregion
  166. }//Class_end
  167. /// <summary>
  168. /// UI(窗体)类型
  169. /// </summary>
  170. internal class UIType
  171. {
  172. //是否需要清空“反向切换”
  173. public bool IsClearReverseChange = false;
  174. //UI窗体类型
  175. public UIFormsType UIForms_Type = UIFormsType.Normal;
  176. //UI窗体显示类型
  177. public UIFormsShowMode UIForms_ShowMode = UIFormsShowMode.Normal;
  178. //UI窗体透明度类型
  179. public UIFormsLucencyType UIForms_LucencyType = UIFormsLucencyType.Impenetrable;
  180. }
  181. }