update
This commit is contained in:
@@ -7,68 +7,54 @@ import { ConfirmDialog } from "./Item/ConfirmDialog";
|
||||
import { CommAdDialog } from "./Item/CommAdDialog";
|
||||
import Utils from "../Main/Common/Utils";
|
||||
import { InnerMsgCode } from "../Main/Config/InnerMsgCode";
|
||||
import { TipsPanel } from "../chat18x/ui/panels/TipsPanel";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//项目管理器
|
||||
@ccclass('SubManager')
|
||||
@ccclass("SubManager")
|
||||
export default class SubManager {
|
||||
|
||||
private static _I: SubManager = null;
|
||||
public static get I(): SubManager {
|
||||
if (!SubManager._I) {
|
||||
SubManager._I = new SubManager();
|
||||
SubManager._I.init();
|
||||
}
|
||||
return SubManager._I;
|
||||
private static _I: SubManager = null;
|
||||
public static get I(): SubManager {
|
||||
if (!SubManager._I) {
|
||||
SubManager._I = new SubManager();
|
||||
SubManager._I.init();
|
||||
}
|
||||
return SubManager._I;
|
||||
}
|
||||
|
||||
private init(){
|
||||
|
||||
private init() {}
|
||||
|
||||
//飘字提示----------------------------------------------------------------------------
|
||||
public static ShowPrompt(text: string) {
|
||||
TipsPanel.show(text);
|
||||
}
|
||||
|
||||
//显示确定框----------------------------------------------------------------------------
|
||||
/**通用确认框 { content: string, strYes?: string, strNo?: string, yesCallback?: Function, noCallback?: Function, closeCallback?: Function } */
|
||||
public static ShowConfirm(param: any) {
|
||||
if (!GameRootUI.I) {
|
||||
console.warn("GameRootUI还未初始化", param);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//飘字提示----------------------------------------------------------------------------
|
||||
public static ShowPrompt(text: string) {
|
||||
if (!GameRootUI.I) {
|
||||
console.warn("GameRootUI还未初始化", text);
|
||||
Utils.sendInnerMsg(InnerMsgCode.UI_ShowPrompt, {text: text});
|
||||
return
|
||||
}
|
||||
ResManager.I.loadSubpackagePrefab("item/promptItem", (n_node: Node)=>{
|
||||
GameRootUI.I.AddUIToLayer(n_node, CommonConfig.UILayerGroup.Layer_tips)
|
||||
let pItem = n_node.getComponent(promptItem)
|
||||
pItem.setLabel(text)
|
||||
})
|
||||
ResManager.I.loadSubpackagePrefab("item/ConfirmDialog", (n_node: Node) => {
|
||||
GameRootUI.I.AddUIToLayer(n_node, CommonConfig.UILayerGroup.Layer_tips);
|
||||
let pItem = n_node.getComponent(ConfirmDialog);
|
||||
pItem.setParam(param);
|
||||
});
|
||||
}
|
||||
|
||||
//显示通用广告框----------------------------------------------------------------------------
|
||||
/**通用广告框 { content: string, strAd?: string, strLeft?: string, adCallback?: Function, leftCallback?: Function, closeCallback?: Function } */
|
||||
public static ShowCommonAdDialog(param: any) {
|
||||
if (!GameRootUI.I) {
|
||||
console.warn("GameRootUI还未初始化", param);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//显示确定框----------------------------------------------------------------------------
|
||||
/**通用确认框 { content: string, strYes?: string, strNo?: string, yesCallback?: Function, noCallback?: Function, closeCallback?: Function } */
|
||||
public static ShowConfirm(param:any) {
|
||||
if (!GameRootUI.I) {
|
||||
console.warn("GameRootUI还未初始化", param);
|
||||
return
|
||||
}
|
||||
ResManager.I.loadSubpackagePrefab("item/ConfirmDialog", (n_node: Node)=>{
|
||||
GameRootUI.I.AddUIToLayer(n_node, CommonConfig.UILayerGroup.Layer_tips)
|
||||
let pItem = n_node.getComponent(ConfirmDialog)
|
||||
pItem.setParam(param)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//显示通用广告框----------------------------------------------------------------------------
|
||||
/**通用广告框 { content: string, strAd?: string, strLeft?: string, adCallback?: Function, leftCallback?: Function, closeCallback?: Function } */
|
||||
public static ShowCommonAdDialog(param:any) {
|
||||
if (!GameRootUI.I) {
|
||||
console.warn("GameRootUI还未初始化", param);
|
||||
return
|
||||
}
|
||||
ResManager.I.loadSubpackagePrefab("item/CommAdDialog", (n_node: Node)=>{
|
||||
GameRootUI.I.AddUIToLayer(n_node, CommonConfig.UILayerGroup.Layer_tips)
|
||||
let pItem = n_node.getComponent(CommAdDialog)
|
||||
pItem.setParam(param)
|
||||
})
|
||||
}
|
||||
}
|
||||
ResManager.I.loadSubpackagePrefab("item/CommAdDialog", (n_node: Node) => {
|
||||
GameRootUI.I.AddUIToLayer(n_node, CommonConfig.UILayerGroup.Layer_tips);
|
||||
let pItem = n_node.getComponent(CommAdDialog);
|
||||
pItem.setParam(param);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user