You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
2.8 KiB
128 lines
2.8 KiB
//框架核心参数
|
|
|
|
import { Color, Layers } from "cc";
|
|
import { UIFormsValue } from "../../const/GameInterface";
|
|
|
|
/*
|
|
*功能:
|
|
* 1,系统常量
|
|
* 2,全局性方法
|
|
* 3,系统枚举类型
|
|
* 4,委托定义
|
|
*/
|
|
|
|
|
|
/**
|
|
* UI窗体(位置)类型
|
|
*/
|
|
export enum UIFromType
|
|
{
|
|
/**最底层场景 */
|
|
Scene = "Scene",
|
|
/**内嵌型 */
|
|
Embedded = "Embedded",
|
|
/**普通窗体 */
|
|
Nomal = "Nomal",
|
|
/**固定窗体 */
|
|
Fixed = "Fixed",
|
|
/**弹出窗体 */
|
|
PopUp = "PopUp",
|
|
/**提示弹窗 */
|
|
Tips = "Tips",
|
|
}
|
|
|
|
|
|
/**
|
|
* UI窗体显示类型
|
|
*/
|
|
export enum UIFromShowType
|
|
{
|
|
/**普通 */
|
|
Nomal = "Nomal",
|
|
/**反向切换 */
|
|
Reversechange ="Reversechange",
|
|
/**隐藏其他 */
|
|
HideOther ="HideOther",
|
|
}
|
|
|
|
/**
|
|
* UI窗体透明度类型
|
|
*/
|
|
export enum UIFormLucenyType {
|
|
/**完全透明,不可以穿透 */
|
|
Luceny = "Luceny",
|
|
/**半透明,不可以穿透 */
|
|
Translucence = "Translucence",
|
|
/**低透明度,不可以穿透 */
|
|
ImPenetrable = "ImPenetrable",
|
|
/**可以穿透 */
|
|
Pentrate = "Pentrate",
|
|
}
|
|
|
|
/**
|
|
* 隐藏类型
|
|
*/
|
|
export enum UIHideType
|
|
{
|
|
/**节点隐藏 */
|
|
active = "active",
|
|
/**节点销毁 */
|
|
destroy = "destroy",
|
|
}
|
|
|
|
//#endregion
|
|
|
|
export class SysDefine
|
|
{
|
|
/**UI脚本名后缀 */
|
|
public static readonly NameSuffix: string = `_Proxy`;
|
|
/**UICanvas预设名 */
|
|
public static readonly SYS_CANVAS_NAME = "UICanvas";
|
|
/**UI根节点路径常量 */
|
|
public static readonly SYS_PATH_CANVAS = "Root";
|
|
/**层级节点路径常量 */
|
|
public static readonly SYS_PATH_LAYER = "Layer";
|
|
/**层级节点路径常量 */
|
|
public static readonly SYS_PATH_EMBEDDED_LAYER = "EmbeddedLayer";
|
|
/**遮罩路径常量 */
|
|
public static readonly SYS_PATH_MASK = "Mask";
|
|
/**UI摄像机路径常量 */
|
|
public static readonly SYS_PATH_UICAMERA = "UICamera";
|
|
/**组别路径常量 */
|
|
public static readonly SYS_GROUP = Layers.Enum.UI_2D;
|
|
/* 遮罩管理器中,透明度常量 */
|
|
|
|
/**完全透明,不能穿透 */
|
|
public static readonly SYS_UIMASK_LUCENCY_COLOR_RGB:Color = new Color(255,255,255,0)
|
|
//半透明,不能穿透
|
|
public static readonly SYS_UIMASK_TRANS_LUCENCY_COLOR_RGB:Color = new Color(0,0,0,127)
|
|
/**低透明,不能穿透 */
|
|
public static readonly SYS_UIMASK_IMPENETRABLE_COLOR_RGB:Color = new Color(0,0,0,220)
|
|
|
|
/*全局性方法*/
|
|
//todo......
|
|
|
|
/*委托的定义*/
|
|
//todo......
|
|
}
|
|
|
|
export interface IUIRes {
|
|
uiUrl:string,
|
|
bundle:string,
|
|
param?:any,
|
|
}
|
|
|
|
export interface IUIPrefabQueue extends IUIRes {
|
|
param: any,
|
|
CallBack?:Function,
|
|
}
|
|
|
|
export const EUIFormsToIUIRes = (Config:UIFormsValue)=>{
|
|
if(Config){
|
|
return {uiUrl: Config.url,bundle: Config.bundle }
|
|
}
|
|
ConsoleEx.Error(`找不到${Config}数据`);
|
|
return { uiUrl: "", bundle: "" }
|
|
}
|
|
|
|
|
|
|