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.
702 lines
42 KiB
702 lines
42 KiB
import User from "../../FrameWork/User/User";
|
|
import Common5 from "../../Platform/th/Common5";
|
|
import TaskManager from "../JuQingChat/TaskManager";
|
|
|
|
import CommonTextTips from "../SCommon/CommonTextTips";
|
|
import GameBase from "../SCommon/GameBase";
|
|
import MoneyFlyEffect from "../SCommon/MoneyFlyEffect";
|
|
import SpecialTipsView from "../SCommon/SpecialTipsView";
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
|
|
export enum parentNodeType {
|
|
baseLayer,
|
|
prefabLayer,
|
|
popLayer,
|
|
}
|
|
export enum GameType {
|
|
None = 0,
|
|
GM,
|
|
|
|
Loading,//加载中
|
|
GetAward,
|
|
CommonTextTips,//通用提示文字
|
|
JuQingDialog,//剧情对话
|
|
ChatList,//微信聊天列表
|
|
ChatDialog,//微信聊天对话
|
|
CeBianLan,
|
|
Feedback,
|
|
Setting,
|
|
BeiBao,
|
|
GDaoYeShouGou,
|
|
CityPrefab,
|
|
TaskInfoNode,
|
|
GuideMskNode,
|
|
SpecialTipsView,
|
|
CheckLayer,
|
|
TaskResult,
|
|
JuQingTipView,
|
|
DingYue,
|
|
|
|
|
|
FirstSelectScene_LeftBtnUI, //初始选择场景左按钮菜单
|
|
FirstSelectScene_LevelView, //初始选择场景关卡界面
|
|
FirstSelectScene_CloudAnimation, //初始选择场景云动画
|
|
FirstSelectScene_StartAnimation, //初始选择场景开始动画
|
|
|
|
CNXX_SelectLevelView,//菜鸟消消选关界面
|
|
CNXX_BuyProp,//菜鸟消消购买道具
|
|
CNXX_Fail,//菜鸟消消失败
|
|
CNXX_Success,//菜鸟消消成功
|
|
CNXX_firstLevel,//菜鸟消消第一关
|
|
CNXX_secondLevel,//菜鸟消消第二关
|
|
CNXX_exitTip,//菜鸟消消退出确认
|
|
|
|
HuangJinYuFu,//黄金渔夫
|
|
ZhanLanGuan,//展览馆
|
|
Paimaihang,
|
|
ShouHuoji,//售货机
|
|
GuPiao,
|
|
KuaiDiZhan,//快递站
|
|
ShiCaiHuiShou,//食材回收
|
|
ZhiShuZaoLin,//植树造林
|
|
|
|
KaiChangGuanQia1,
|
|
// JuQingGuanQia2,
|
|
GameStory2,
|
|
GameStory3,
|
|
GameStory4,
|
|
GameStory5,
|
|
GameStory14,
|
|
GameStory22,
|
|
|
|
RoomCommon,
|
|
RoomNone,//空房间
|
|
Room1,
|
|
Room2,
|
|
Room3,
|
|
Room4,
|
|
Room5,
|
|
Room6,
|
|
Room7,
|
|
Room8,
|
|
Room9,
|
|
Room10,
|
|
Room11,
|
|
Room12,
|
|
Room13,
|
|
Room14,
|
|
Room15,
|
|
Room16,
|
|
Room17,
|
|
Room18,
|
|
Room19,
|
|
Room20,
|
|
Room21,
|
|
Room22,
|
|
Room23,
|
|
Room24,
|
|
Room25,
|
|
|
|
JiuPingHuiShou,
|
|
ChaoCai,
|
|
ChaoCaiResult,
|
|
TouZiXieYiShu,
|
|
ZuLinHeTong,
|
|
CaiShangLevel1,
|
|
CaiShangLevel2,
|
|
CaiShangLevel3,
|
|
CaiShangLevel4,
|
|
|
|
ZhongCanTing,
|
|
ZhongCanTingShengJi,
|
|
JianLouBox,
|
|
YiMaJiang,
|
|
YiMaJiangXuanGuan,
|
|
YiMaJiangResult,
|
|
TiShengShouYi,
|
|
LiXianShouYi,
|
|
MaoYiFenHong,
|
|
|
|
|
|
/**新增 */
|
|
DiaoYu,
|
|
MeiNvZhaoMu,
|
|
|
|
HuXinGongYuan,
|
|
HuXinGouMai,
|
|
HuXinJianDing,
|
|
|
|
KaiKuangFirstView,
|
|
KaiKuangMainView,
|
|
|
|
ChoushuiFirst,
|
|
ChoushuiTwo,
|
|
|
|
CiShanChouJiang,
|
|
|
|
DH_1,
|
|
DH_2,
|
|
DH_3,
|
|
DH_4,
|
|
DH_5,
|
|
DH_6,
|
|
DH_7,
|
|
DH_8,
|
|
DH_9,
|
|
DH_10,
|
|
DH_11,
|
|
DH_12,
|
|
DH_13,
|
|
DH_14,
|
|
DH_15,
|
|
DH_16,
|
|
DH_17,
|
|
DH_18,
|
|
DH_19,
|
|
DH_20,
|
|
DH_21,
|
|
DH_22,
|
|
DH_23,
|
|
DH_24,
|
|
DH_25,
|
|
DH_26,
|
|
DH_27,
|
|
DH_28,
|
|
blackGuoDu,
|
|
DH_29,
|
|
DH_30,
|
|
tuyin,//合并兔印
|
|
xiangyin,//合并象印
|
|
guiyin,//合并龟印
|
|
huyin,//合并虎印
|
|
fengyin,//合并凤印
|
|
|
|
TaskInfoNode_UP,//有两种任务弹出方式
|
|
DH_31,
|
|
DH_32,
|
|
DH_33,
|
|
DH_34,
|
|
}
|
|
//子游戏id
|
|
export let SubGameId = {
|
|
|
|
|
|
}
|
|
|
|
//子游戏命名
|
|
//侦探社 刮刮乐 垃圾站 八星级酒店 冰雪世界 恋家房产
|
|
// 富豪会所 私募基金 摩托配件 湖心公园 电玩城 痛风快递 网红基地 游艇会 高尔夫球场
|
|
/**
|
|
* *********只能往后面增加prefab*********
|
|
*/
|
|
let AllPrefabConfig = [
|
|
{ desc: "GM", gameType: GameType.GM, bundleName: "CommonRes", prefabUrl: "prefab/GM" },
|
|
{ desc: "Check", gameType: GameType.CheckLayer, bundleName: "CommonRes", prefabUrl: "prefab/checkLayer" },
|
|
{ desc: "GuideMskNode", gameType: GameType.GuideMskNode, bundleName: "CommonRes", prefabUrl: "prefab/GuideMskNode" },
|
|
{ desc: "通用提示文字", dadianTag: '', wanJiaDaDianTag: "", gameType: GameType.CommonTextTips, bundleName: "CommonRes", prefabUrl: "prefab/commonTextTips", isNeedLoading: false },
|
|
{ desc: "奖励窗", dadianTag: '', wanJiaDaDianTag: "", gameType: GameType.GetAward, bundleName: "CommonRes", prefabUrl: "prefab/getAward", isNeedLoading: false },
|
|
{ desc: "任务信息", gameType: GameType.TaskInfoNode, bundleName: "GameRes", prefabUrl: "JuQingChat/prefab/taskInfoNode" },
|
|
{ desc: "剧情对话", gameType: GameType.JuQingDialog, bundleName: "GameRes", prefabUrl: "JuQingChat/prefab/juQingDialog" },
|
|
{ desc: "微信聊天列表", gameType: GameType.ChatList, bundleName: "GameRes", prefabUrl: "JuQingChat/prefab/chatList", dadianTag: '聊天列表-进入', wanJiaDaDianTag: "微信聊天列表-玩家", isNeedLoading: true },
|
|
{ desc: "微信聊天对话", gameType: GameType.ChatDialog, bundleName: "GameRes", prefabUrl: "JuQingChat/prefab/chatDialog", dadianTag: '聊天对话-进入', wanJiaDaDianTag: "微信聊天对话-玩家", isNeedLoading: true },
|
|
|
|
{ desc: "侧边栏福利", gameType: GameType.CeBianLan, bundleName: "GameRes", prefabUrl: "侧边栏/prefab/Cebianlan", isNeedLoading: true },
|
|
{ desc: "反馈", gameType: GameType.Feedback, bundleName: "GameRes", prefabUrl: "Feedback/prefab/Feedback", isNeedLoading: true },
|
|
{ desc: "设置", gameType: GameType.Setting, bundleName: "GameRes", prefabUrl: "游戏设置/prefab/setting", isNeedLoading: true },
|
|
{ desc: "背包", gameType: GameType.BeiBao, bundleName: "BeiBao", prefabUrl: "prefab/beibaoPrefab", dadianTag: '背包-进入', wanJiaDaDianTag: "背包-玩家", isNeedLoading: true },
|
|
{ desc: "倒爷收购", gameType: GameType.GDaoYeShouGou, cityNodeName: 'daoye', bundleName: "GameRes", prefabUrl: "倒爷收购/prefab/DaoYeShouGou", dadianTag: '倒爷收购-进入', wanJiaDaDianTag: "倒爷收购-玩家", isNeedLoading: true },
|
|
{ desc: "城镇", gameType: GameType.CityPrefab, bundleName: "XianCheng", prefabUrl: "prefab/CityPrefab", isNeedLoading: true, dadianTag: '城镇-进入', wanJiaDaDianTag: "城镇-玩家" },
|
|
{ desc: "特殊提示框", gameType: GameType.SpecialTipsView, bundleName: "CommonRes", prefabUrl: "prefab/specialTipsView", dadianTag: '心愿单-进入', wanJiaDaDianTag: "心愿单-玩家" },
|
|
{ desc: "剧情任务结果", gameType: GameType.TaskResult, bundleName: "MainPrefab", prefabUrl: "prefab/taskResult", dadianTag: '剧情任务结果-进入', wanJiaDaDianTag: "剧情任务结果-玩家", isNeedLoading: false },
|
|
{ desc: "剧情提示", gameType: GameType.JuQingTipView, bundleName: "GameRes", prefabUrl: "JuQingTips/prefab/JuQingTipView", dadianTag: '剧情提示-进入', wanJiaDaDianTag: "剧情提示-玩家", isNeedLoading: false },
|
|
{ desc: "订阅", gameType: GameType.DingYue, bundleName: "CommonRes", prefabUrl: "prefab/dingYueBox" },
|
|
|
|
|
|
|
|
{ desc: "初始选择场景左按钮菜单", gameType: GameType.FirstSelectScene_LeftBtnUI, bundleName: "FirstSelectScene", prefabUrl: "prefab/LeftBtnUI", isNeedLoading: false },
|
|
{ desc: "初始选择场景关卡界面", gameType: GameType.FirstSelectScene_LevelView, bundleName: "FirstSelectScene", prefabUrl: "prefab/LevelView", isNeedLoading: false },
|
|
{ desc: "初始选择场景云动画", gameType: GameType.FirstSelectScene_CloudAnimation, bundleName: "FirstSelectScene", prefabUrl: "prefab/CloudAnimation", isNeedLoading: false },
|
|
{ desc: "初始选择场景开始动画", gameType: GameType.FirstSelectScene_StartAnimation, bundleName: "FirstSelectScene", prefabUrl: "prefab/StartAnimation", isNeedLoading: false },
|
|
|
|
{ desc: "菜鸟消消第一关", gameType: GameType.CNXX_firstLevel, bundleName: "cainiaoxiaoxiao", prefabUrl: "prefab/CNXX_firstLevel", isNeedLoading: true },
|
|
{ desc: "菜鸟消消第二关", gameType: GameType.CNXX_secondLevel, bundleName: "cainiaoxiaoxiao", prefabUrl: "prefab/CNXX_secondLevel", isNeedLoading: true },
|
|
{ desc: "菜鸟消消选关界面", gameType: GameType.CNXX_SelectLevelView, bundleName: "cainiaoxiaoxiao", prefabUrl: "prefab/CNXX_SelectLevelView", isNeedLoading: true },
|
|
{ desc: "菜鸟消消购买道具", gameType: GameType.CNXX_BuyProp, bundleName: "cainiaoxiaoxiao", prefabUrl: "prefab/buyPropNode", isNeedLoading: true },
|
|
{ desc: "菜鸟消消失败", gameType: GameType.CNXX_Fail, bundleName: "cainiaoxiaoxiao", prefabUrl: "prefab/result_fail", isNeedLoading: true },
|
|
{ desc: "菜鸟消消成功", gameType: GameType.CNXX_Success, bundleName: "cainiaoxiaoxiao", prefabUrl: "prefab/result_success", isNeedLoading: true },
|
|
{ desc: "菜鸟消消退出确认", gameType: GameType.CNXX_exitTip, bundleName: "cainiaoxiaoxiao", prefabUrl: "prefab/exitTip_cnxx", isNeedLoading: true },
|
|
|
|
{ desc: "黄金渔夫", gameType: GameType.HuangJinYuFu, bundleName: "huangjinyufu", prefabUrl: "prefab/HuangJinYuFu", dadianTag: '黄金渔夫-进入', wanJiaDaDianTag: "黄金渔夫-玩家", isNeedLoading: true },
|
|
{ desc: "展览馆", gameType: GameType.ZhanLanGuan, bundleName: "huangjinyufu", prefabUrl: "prefab/ZhanLanGuan", dadianTag: '展览馆-进入', wanJiaDaDianTag: "展览馆-玩家", isNeedLoading: true },
|
|
|
|
{ desc: "快递站", gameType: GameType.KuaiDiZhan, bundleName: "kuaidizhan", prefabUrl: "prefab/KuaiDiZhan", dadianTag: '快递站-进入', wanJiaDaDianTag: "快递站-玩家", isNeedLoading: true, isNeedReleaseBundle: false },
|
|
{ desc: "食材回收", gameType: GameType.ShiCaiHuiShou, bundleName: "shicaihuishou", prefabUrl: "prefab/ShiCaiHuiShou", dadianTag: '食材回收-进入', wanJiaDaDianTag: "食材回收-玩家", isNeedLoading: true, isNeedReleaseBundle: false },
|
|
{ desc: "拍卖行", gameType: GameType.Paimaihang, bundleName: "Paimaihang", prefabUrl: "prefab/paimaihang", dadianTag: '拍卖行-进入', wanJiaDaDianTag: "拍卖行-玩家", isNeedLoading: true },
|
|
{ desc: "售货机", gameType: GameType.ShouHuoji, bundleName: "shouhuoji", prefabUrl: "prefab/ShouHuoji", dadianTag: '售货机-进入', wanJiaDaDianTag: "售货机-玩家", isNeedLoading: true },
|
|
{ desc: "股票", gameType: GameType.GuPiao, bundleName: "zhengquanzhongxin", prefabUrl: "prefab/stockMarketLayer", dadianTag: '证券中心-进入', wanJiaDaDianTag: "证券中心-玩家", isNeedLoading: true },
|
|
{ desc: "植树造林", gameType: GameType.ZhiShuZaoLin, bundleName: "zhishuzaolin", prefabUrl: "prefab/ZhiShuZaoLin", dadianTag: '植树造林-进入', wanJiaDaDianTag: "植树造林-玩家", isNeedLoading: true },
|
|
|
|
{ desc: "开场关卡1", gameType: GameType.KaiChangGuanQia1, bundleName: "KaiChangGuanQia1", prefabUrl: "prefab/KaiChangGuanQia1", dadianTag: '开场关卡1-进入', wanJiaDaDianTag: "开场关卡1-玩家", isNeedLoading: true },
|
|
{ desc: "游戏文字剧情2", gameType: GameType.GameStory2, bundleName: "GameStory2", prefabUrl: "prefab/GameStory2", dadianTag: '游戏文字剧情2-进入', wanJiaDaDianTag: "游戏文字剧情2-玩家", isNeedLoading: true },
|
|
{ desc: "游戏文字剧情3", gameType: GameType.GameStory3, bundleName: "GameStory3", prefabUrl: "prefab/GameStory3", dadianTag: '游戏文字剧情3-进入', wanJiaDaDianTag: "游戏文字剧情3-玩家", isNeedLoading: true },
|
|
{ desc: "游戏文字剧情4", gameType: GameType.GameStory4, bundleName: "GameStory4", prefabUrl: "prefab/GameStory4", dadianTag: '游戏文字剧情4-进入', wanJiaDaDianTag: "游戏文字剧情4-玩家", isNeedLoading: true },
|
|
{ desc: "游戏文字剧情5", gameType: GameType.GameStory5, bundleName: "GameStory5", prefabUrl: "prefab/GameStory5", dadianTag: '游戏文字剧情5-进入', wanJiaDaDianTag: "游戏文字剧情5-玩家", isNeedLoading: true },
|
|
{ desc: "游戏文字剧情14", gameType: GameType.GameStory14, bundleName: "GameStory14", prefabUrl: "prefab/GameStory14", dadianTag: '游戏文字剧情14-进入', wanJiaDaDianTag: "游戏文字剧情14-玩家", isNeedLoading: true },
|
|
{ desc: "游戏文字剧情22", gameType: GameType.GameStory22, bundleName: "GameStory22", prefabUrl: "prefab/GameStory22", dadianTag: '游戏文字剧情22-进入', wanJiaDaDianTag: "游戏文字剧情22-玩家", isNeedLoading: true },
|
|
{ desc: "房间common", gameType: GameType.RoomCommon, bundleName: "RoomCommon", prefabUrl: "prefab/RoomCommon", dadianTag: '房间common-进入', wanJiaDaDianTag: "房间common-玩家", isNeedLoading: true },
|
|
{ desc: "房间1", gameType: GameType.Room1, bundleName: "Room1", prefabUrl: "prefab/Room1", dadianTag: '房间1-进入', wanJiaDaDianTag: "房间1-玩家", isNeedLoading: false },
|
|
{ desc: "房间2", gameType: GameType.Room2, bundleName: "Room2", prefabUrl: "prefab/Room2", dadianTag: '房间2-进入', wanJiaDaDianTag: "房间2-玩家", isNeedLoading: true },
|
|
{ desc: "房间3", gameType: GameType.Room3, bundleName: "Room3", prefabUrl: "prefab/Room3", dadianTag: '房间3-进入', wanJiaDaDianTag: "房间3-玩家", isNeedLoading: true },
|
|
{ desc: "房间4", gameType: GameType.Room4, bundleName: "Room4", prefabUrl: "prefab/Room4", dadianTag: '房间4-进入', wanJiaDaDianTag: "房间4-玩家", isNeedLoading: true },
|
|
{ desc: "房间5", gameType: GameType.Room5, bundleName: "Room5", prefabUrl: "prefab/Room5", dadianTag: '房间5-进入', wanJiaDaDianTag: "房间5-玩家", isNeedLoading: true },
|
|
{ desc: "房间6", gameType: GameType.Room6, bundleName: "Room6", prefabUrl: "prefab/Room6", dadianTag: '房间6-进入', wanJiaDaDianTag: "房间6-玩家", isNeedLoading: true },
|
|
{ desc: "房间7", gameType: GameType.Room7, bundleName: "Room7", prefabUrl: "prefab/Room7", dadianTag: '房间7-进入', wanJiaDaDianTag: "房间7-玩家", isNeedLoading: true },
|
|
{ desc: "房间8", gameType: GameType.Room8, bundleName: "Room8", prefabUrl: "prefab/Room8", dadianTag: '房间8-进入', wanJiaDaDianTag: "房间8-玩家", isNeedLoading: true },
|
|
{ desc: "房间9", gameType: GameType.Room9, bundleName: "Room9", prefabUrl: "prefab/Room9", dadianTag: '房间9-进入', wanJiaDaDianTag: "房间9-玩家", isNeedLoading: true },
|
|
{ desc: "房间10", gameType: GameType.Room10, bundleName: "Room10", prefabUrl: "prefab/Room10", dadianTag: '房间10-进入', wanJiaDaDianTag: "房间10-玩家", isNeedLoading: true },
|
|
{ desc: "房间11", gameType: GameType.Room11, bundleName: "Room11", prefabUrl: "prefab/Room11", dadianTag: '房间11-进入', wanJiaDaDianTag: "房间11-玩家", isNeedLoading: true },
|
|
{ desc: "房间12", gameType: GameType.Room12, bundleName: "Room12", prefabUrl: "prefab/Room12", dadianTag: '房间12-进入', wanJiaDaDianTag: "房间12-玩家", isNeedLoading: true },
|
|
{ desc: "房间13", gameType: GameType.Room13, bundleName: "Room13", prefabUrl: "prefab/Room13", dadianTag: '房间13-进入', wanJiaDaDianTag: "房间13-玩家", isNeedLoading: true },
|
|
{ desc: "房间14", gameType: GameType.Room14, bundleName: "Room14", prefabUrl: "prefab/Room14", dadianTag: '房间14-进入', wanJiaDaDianTag: "房间14-玩家", isNeedLoading: true },
|
|
{ desc: "房间15", gameType: GameType.Room15, bundleName: "Room15", prefabUrl: "prefab/Room15", dadianTag: '房间15-进入', wanJiaDaDianTag: "房间15-玩家", isNeedLoading: true },
|
|
{ desc: "房间16", gameType: GameType.Room16, bundleName: "Room16", prefabUrl: "prefab/Room16", dadianTag: '房间16-进入', wanJiaDaDianTag: "房间16-玩家", isNeedLoading: true },
|
|
{ desc: "房间17", gameType: GameType.Room17, bundleName: "Room17", prefabUrl: "prefab/Room17", dadianTag: '房间17-进入', wanJiaDaDianTag: "房间17-玩家", isNeedLoading: true },
|
|
{ desc: "房间18", gameType: GameType.Room18, bundleName: "Room18", prefabUrl: "prefab/Room18", dadianTag: '房间18-进入', wanJiaDaDianTag: "房间18-玩家", isNeedLoading: true },
|
|
{ desc: "房间19", gameType: GameType.Room19, bundleName: "Room19", prefabUrl: "prefab/Room19", dadianTag: '房间19-进入', wanJiaDaDianTag: "房间19-玩家", isNeedLoading: true },
|
|
{ desc: "房间20", gameType: GameType.Room20, bundleName: "Room20", prefabUrl: "prefab/Room20", dadianTag: '房间20-进入', wanJiaDaDianTag: "房间20-玩家", isNeedLoading: true },
|
|
{ desc: "房间21", gameType: GameType.Room21, bundleName: "Room21", prefabUrl: "prefab/Room21", dadianTag: '房间21-进入', wanJiaDaDianTag: "房间21-玩家", isNeedLoading: true },
|
|
{ desc: "房间22", gameType: GameType.Room22, bundleName: "Room22", prefabUrl: "prefab/Room22", dadianTag: '房间22-进入', wanJiaDaDianTag: "房间22-玩家", isNeedLoading: true },
|
|
{ desc: "房间23", gameType: GameType.Room23, bundleName: "Room23", prefabUrl: "prefab/Room23", dadianTag: '房间23-进入', wanJiaDaDianTag: "房间23-玩家", isNeedLoading: true },
|
|
{ desc: "房间24", gameType: GameType.Room24, bundleName: "Room24", prefabUrl: "prefab/Room24", dadianTag: '房间24-进入', wanJiaDaDianTag: "房间24-玩家", isNeedLoading: true },
|
|
{ desc: "房间25", gameType: GameType.Room25, bundleName: "Room25", prefabUrl: "prefab/Room25", dadianTag: '房间25-进入', wanJiaDaDianTag: "房间25-玩家", isNeedLoading: true },
|
|
|
|
{ desc: "废瓶回收", gameType: GameType.JiuPingHuiShou, bundleName: "jiuPingHuiShou", prefabUrl: "prefab/JiuPingHuiShou", dadianTag: '废瓶回收-进入', wanJiaDaDianTag: "废瓶回收-玩家", isNeedLoading: true },
|
|
{ desc: "炒菜", gameType: GameType.ChaoCai, bundleName: "ChaoCai", prefabUrl: "prefab/ChaoCai", dadianTag: '炒菜-进入', wanJiaDaDianTag: "炒菜-玩家", isNeedLoading: true },
|
|
{ desc: "炒菜结果", gameType: GameType.ChaoCaiResult, bundleName: "ChaoCai", prefabUrl: "prefab/ChaoCaiResult", dadianTag: '炒菜结果-进入', wanJiaDaDianTag: "炒菜结果-玩家", isNeedLoading: true },
|
|
{ desc: "投资协议书", gameType: GameType.TouZiXieYiShu, bundleName: "TouZiXieYiShu", prefabUrl: "prefab/TouZiXieYiShu", dadianTag: '投资协议书-进入', wanJiaDaDianTag: "投资协议书-玩家", isNeedLoading: true },
|
|
{ desc: "租赁合同", gameType: GameType.ZuLinHeTong, bundleName: "ZuLinHeTong", prefabUrl: "prefab/ZuLinHeTong", dadianTag: '租赁合同-进入', wanJiaDaDianTag: "租赁合同-玩家", isNeedLoading: true },
|
|
{ desc: "财商一级界面", gameType: GameType.CaiShangLevel1, bundleName: "GuShiCaoPan", prefabUrl: "prefab/CaiShangLayer", dadianTag: '财商一级界面-进入', wanJiaDaDianTag: "财商一级界面-玩家", isNeedLoading: true },
|
|
{ desc: "财商二级界面", gameType: GameType.CaiShangLevel2, bundleName: "GuShiCaoPan", prefabUrl: "prefab/CaiShangLayer2", dadianTag: '财商二级界面-进入', wanJiaDaDianTag: "财商二级界面-玩家", isNeedLoading: true },
|
|
{ desc: "财商提示", gameType: GameType.CaiShangLevel3, bundleName: "GuShiCaoPan", prefabUrl: "prefab/CaiShangLayer3", dadianTag: '财商提示-进入', wanJiaDaDianTag: "财商提示-玩家", isNeedLoading: false },
|
|
{ desc: "财商结束", gameType: GameType.CaiShangLevel4, bundleName: "GuShiCaoPan", prefabUrl: "prefab/CaiShangLayer4", dadianTag: '财商结束-进入', wanJiaDaDianTag: "财商结束-玩家", isNeedLoading: false },
|
|
{ desc: "中餐厅", gameType: GameType.ZhongCanTing, bundleName: "ZhongCanTing", prefabUrl: "prefab/ZhongCanTing", dadianTag: '中餐厅-进入', wanJiaDaDianTag: "中餐厅-玩家", isNeedLoading: false },
|
|
{ desc: "中餐厅升级", gameType: GameType.ZhongCanTingShengJi, bundleName: "ZhongCanTingShengJi", prefabUrl: "prefab/ZhongCanTingShengJi", dadianTag: '中餐厅升级-进入', wanJiaDaDianTag: "中餐厅升级-玩家", isNeedLoading: false },
|
|
{ desc: "建楼弹框", gameType: GameType.JianLouBox, bundleName: "XianCheng", prefabUrl: "prefab/JianLouBox", dadianTag: '建楼弹框-进入', wanJiaDaDianTag: "建楼弹框-玩家", isNeedLoading: false },
|
|
{ desc: "移麻将", gameType: GameType.YiMaJiang, bundleName: "YiMaJiang", prefabUrl: "prefab/YiMaJiang", dadianTag: '移麻将-进入', wanJiaDaDianTag: "移麻将-玩家", isNeedLoading: true },
|
|
{ desc: "移麻将选关", gameType: GameType.YiMaJiangXuanGuan, bundleName: "YiMaJiang", prefabUrl: "prefab/YiMaJiangXuanGuan", dadianTag: '移麻将选关-进入', wanJiaDaDianTag: "移麻将选关-玩家", isNeedLoading: true },
|
|
{ desc: "移麻将结果", gameType: GameType.YiMaJiangResult, bundleName: "YiMaJiang", prefabUrl: "prefab/YiMaJiangResult", dadianTag: '移麻将结果-进入', wanJiaDaDianTag: "移麻将结果-玩家", isNeedLoading: true },
|
|
{ desc: "提升收益", gameType: GameType.TiShengShouYi, bundleName: "TiShengShouYi", prefabUrl: "prefab/TiShengShouYi", dadianTag: '提升收益-进入', wanJiaDaDianTag: "提升收益-玩家", isNeedLoading: true },
|
|
{ desc: "离线收益", gameType: GameType.LiXianShouYi, bundleName: "LiXianShouYi", prefabUrl: "prefab/LiXianShouYi", dadianTag: '离线收益-进入', wanJiaDaDianTag: "离线收益-玩家", isNeedLoading: true },
|
|
{ desc: "贸易分红", gameType: GameType.MaoYiFenHong, bundleName: "MaoYiFenHong", prefabUrl: "prefab/MaoYiFenHong", dadianTag: '贸易分红-进入', wanJiaDaDianTag: "贸易分红-玩家", isNeedLoading: true },
|
|
|
|
{ desc: "钓鱼", gameType: GameType.DiaoYu, bundleName: "diaoyu", prefabUrl: "prefab/diaoyu", dadianTag: '钓鱼-进入', wanJiaDaDianTag: "钓鱼-玩家", isNeedLoading: true },
|
|
{ desc: "美女招募", gameType: GameType.MeiNvZhaoMu, bundleName: "meiNvZhaoMu", prefabUrl: "prefab/meiNvZhaoMu", dadianTag: '美女招募-进入', wanJiaDaDianTag: "美女招募-玩家", isNeedLoading: true },
|
|
{ desc: "湖心公园", gameType: GameType.HuXinGongYuan, bundleName: "huxingongyuan", prefabUrl: "prefab/huxingongyuanLayer", dadianTag: '古玩市场-进入', wanJiaDaDianTag: "古玩市场-玩家", isNeedLoading: true },
|
|
{ desc: "古董购买", gameType: GameType.HuXinGouMai, bundleName: "huxingongyuan", prefabUrl: "prefab/fangruBeibao", dadianTag: '古董购买-进入', wanJiaDaDianTag: "古董购买-玩家", isNeedLoading: false },
|
|
{ desc: "古董鉴定", gameType: GameType.HuXinJianDing, bundleName: "huxingongyuan", prefabUrl: "prefab/jiandingLayer", dadianTag: '古董鉴定-进入', wanJiaDaDianTag: "古董鉴定-玩家", isNeedLoading: false },
|
|
{ desc: "选择矿山", gameType: GameType.KaiKuangFirstView, bundleName: "kaiKuang", prefabUrl: "prefab/kaiKuangFirstView", dadianTag: '选择矿山-进入', wanJiaDaDianTag: "选择矿山-玩家", isNeedLoading: true },
|
|
{ desc: "开矿", gameType: GameType.KaiKuangMainView, bundleName: "kaiKuang", prefabUrl: "prefab/kaiKuangMainView", dadianTag: '开矿-进入', wanJiaDaDianTag: "开矿-玩家", isNeedLoading: true },
|
|
{ desc: "抽水1", cityNodeName: 'taofen抽水', gameType: GameType.ChoushuiFirst, bundleName: "Choushui", prefabUrl: "prefab/ChoushuiFirst", dadianTag: "抽水-进入", wanjiaDaDianTag: "抽水-玩家", isNeedLoading: true },
|
|
{ desc: "抽水2", gameType: GameType.ChoushuiTwo, bundleName: "Choushui", prefabUrl: "prefab/ChoushuiTwo", dadianTag: "抽水", wanjiaDaDianTag: "抽水", isNeedLoading: true },
|
|
{ desc: "慈善抽奖", gameType: GameType.CiShanChouJiang, bundleName: "CiShanChouJiang", prefabUrl: "prefab/CiShanChouJiang", dadianTag: "慈善抽奖", wanjiaDaDianTag: "慈善抽奖", isNeedLoading: true },
|
|
{ desc: "DH_1", gameType: GameType.DH_1, bundleName: "DH_1", prefabUrl: "DH_1", dadianTag: "DH_1", wanjiaDaDianTag: "DH_1", isNeedLoading: true },
|
|
{ desc: "DH_2", gameType: GameType.DH_2, bundleName: "DH_2", prefabUrl: "DH_2", dadianTag: "DH_2", wanjiaDaDianTag: "DH_2", isNeedLoading: true },
|
|
{ desc: "DH_3", gameType: GameType.DH_3, bundleName: "DH_3", prefabUrl: "DH_3", dadianTag: "DH_3", wanjiaDaDianTag: "DH_3", isNeedLoading: true },
|
|
{ desc: "DH_4", gameType: GameType.DH_4, bundleName: "DH_4", prefabUrl: "DH_4", dadianTag: "DH_4", wanjiaDaDianTag: "DH_4", isNeedLoading: true },
|
|
{ desc: "DH_5", gameType: GameType.DH_5, bundleName: "DH_5", prefabUrl: "DH_5", dadianTag: "DH_5", wanjiaDaDianTag: "DH_5", isNeedLoading: true },
|
|
{ desc: "DH_6", gameType: GameType.DH_6, bundleName: "DH_6", prefabUrl: "DH_6", dadianTag: "DH_6", wanjiaDaDianTag: "DH_6", isNeedLoading: true },
|
|
{ desc: "DH_7", gameType: GameType.DH_7, bundleName: "DH_7", prefabUrl: "DH_7", dadianTag: "DH_7", wanjiaDaDianTag: "DH_7", isNeedLoading: true },
|
|
{ desc: "DH_8", gameType: GameType.DH_8, bundleName: "DH_8", prefabUrl: "DH_8", dadianTag: "DH_8", wanjiaDaDianTag: "DH_8", isNeedLoading: true },
|
|
{ desc: "DH_9", gameType: GameType.DH_9, bundleName: "DH_9", prefabUrl: "DH_9", dadianTag: "DH_9", wanjiaDaDianTag: "DH_9", isNeedLoading: true },
|
|
{ desc: "DH_10", gameType: GameType.DH_10, bundleName: "DH_10", prefabUrl: "DH_10", dadianTag: "DH_10", wanjiaDaDianTag: "DH_10", isNeedLoading: true },
|
|
{ desc: "DH_11", gameType: GameType.DH_11, bundleName: "DH_11", prefabUrl: "DH_11", dadianTag: "DH_11", wanjiaDaDianTag: "DH_11", isNeedLoading: true },
|
|
{ desc: "DH_12", gameType: GameType.DH_12, bundleName: "DH_12", prefabUrl: "DH_12", dadianTag: "DH_12", wanjiaDaDianTag: "DH_12", isNeedLoading: true },
|
|
{ desc: "DH_13", gameType: GameType.DH_13, bundleName: "DH_13", prefabUrl: "DH_13", dadianTag: "DH_13", wanjiaDaDianTag: "DH_13", isNeedLoading: true },
|
|
{ desc: "DH_14", gameType: GameType.DH_14, bundleName: "DH_14", prefabUrl: "DH_14", dadianTag: "DH_14", wanjiaDaDianTag: "DH_14", isNeedLoading: true },
|
|
{ desc: "DH_15", gameType: GameType.DH_15, bundleName: "DH_15", prefabUrl: "DH_15", dadianTag: "DH_15", wanjiaDaDianTag: "DH_15", isNeedLoading: true },
|
|
{ desc: "DH_16", gameType: GameType.DH_16, bundleName: "DH_16", prefabUrl: "DH_16", dadianTag: "DH_16", wanjiaDaDianTag: "DH_16", isNeedLoading: true },
|
|
{ desc: "DH_17", gameType: GameType.DH_17, bundleName: "DH_17", prefabUrl: "DH_17", dadianTag: "DH_17", wanjiaDaDianTag: "DH_17", isNeedLoading: true },
|
|
{ desc: "DH_18", gameType: GameType.DH_18, bundleName: "DH_18", prefabUrl: "DH_18", dadianTag: "DH_18", wanjiaDaDianTag: "DH_18", isNeedLoading: true },
|
|
{ desc: "DH_19", gameType: GameType.DH_19, bundleName: "DH_19", prefabUrl: "DH_19", dadianTag: "DH_19", wanjiaDaDianTag: "DH_19", isNeedLoading: true },
|
|
{ desc: "DH_20", gameType: GameType.DH_20, bundleName: "DH_20", prefabUrl: "DH_20", dadianTag: "DH_20", wanjiaDaDianTag: "DH_20", isNeedLoading: true },
|
|
{ desc: "DH_21", gameType: GameType.DH_21, bundleName: "DH_21", prefabUrl: "DH_21", dadianTag: "DH_21", wanjiaDaDianTag: "DH_21", isNeedLoading: true },
|
|
{ desc: "DH_22", gameType: GameType.DH_22, bundleName: "DH_22", prefabUrl: "DH_22", dadianTag: "DH_22", wanjiaDaDianTag: "DH_22", isNeedLoading: true },
|
|
{ desc: "DH_23", gameType: GameType.DH_23, bundleName: "DH_23", prefabUrl: "DH_23", dadianTag: "DH_23", wanjiaDaDianTag: "DH_23", isNeedLoading: true },
|
|
{ desc: "DH_24", gameType: GameType.DH_24, bundleName: "DH_24", prefabUrl: "DH_24", dadianTag: "DH_24", wanjiaDaDianTag: "DH_24", isNeedLoading: true },
|
|
{ desc: "DH_25", gameType: GameType.DH_25, bundleName: "DH_25", prefabUrl: "DH_25", dadianTag: "DH_25", wanjiaDaDianTag: "DH_25", isNeedLoading: true },
|
|
{ desc: "DH_26", gameType: GameType.DH_26, bundleName: "DH_26", prefabUrl: "DH_26", dadianTag: "DH_26", wanjiaDaDianTag: "DH_26", isNeedLoading: true },
|
|
{ desc: "DH_27", gameType: GameType.DH_27, bundleName: "DH_27", prefabUrl: "DH_27", dadianTag: "DH_27", wanjiaDaDianTag: "DH_27", isNeedLoading: true },
|
|
{ desc: "DH_28", gameType: GameType.DH_28, bundleName: "DH_28", prefabUrl: "DH_28", dadianTag: "DH_28", wanjiaDaDianTag: "DH_28", isNeedLoading: true },
|
|
{ desc: "黑屏过渡", gameType: GameType.blackGuoDu, bundleName: "CommonRes", prefabUrl: "prefab/blackGuoDu" },
|
|
{ desc: "DH_29", gameType: GameType.DH_29, bundleName: "DH_29", prefabUrl: "DH_29", dadianTag: "DH_29", wanjiaDaDianTag: "DH_29", isNeedLoading: true },
|
|
{ desc: "DH_30", gameType: GameType.DH_30, bundleName: "DH_30", prefabUrl: "DH_30", dadianTag: "DH_30", wanjiaDaDianTag: "DH_30", isNeedLoading: true },
|
|
{ desc: "合并兔印碎片", gameType: GameType.tuyin, bundleName: "SuiPian", prefabUrl: "tuyin/tuyin", dadianTag: "tuyin", wanjiaDaDianTag: "tuyin", isNeedLoading: true },
|
|
{ desc: "合并象印碎片", gameType: GameType.xiangyin, bundleName: "SuiPian", prefabUrl: "xiangyin/xiangyin", dadianTag: "xiangyin", wanjiaDaDianTag: "xiangyin", isNeedLoading: true },
|
|
{ desc: "合并龟印碎片", gameType: GameType.guiyin, bundleName: "SuiPian", prefabUrl: "guiyin/guiyin", dadianTag: "guiyin", wanjiaDaDianTag: "guiyin", isNeedLoading: true },
|
|
{ desc: "合并虎印碎片", gameType: GameType.huyin, bundleName: "SuiPian", prefabUrl: "huyin/huyin", dadianTag: "huyin", wanjiaDaDianTag: "huyin", isNeedLoading: true },
|
|
{ desc: "合并凤印碎片", gameType: GameType.fengyin, bundleName: "SuiPian", prefabUrl: "fengyin/fengyin", dadianTag: "fengyin", wanjiaDaDianTag: "fengyin", isNeedLoading: true },
|
|
{ desc: "任务信息", gameType: GameType.TaskInfoNode_UP, bundleName: "GameRes", prefabUrl: "JuQingChat/prefab/taskInfoNode_up" },
|
|
{ desc: "DH_31", gameType: GameType.DH_31, bundleName: "DH_31", prefabUrl: "DH_31", dadianTag: "DH_31", wanjiaDaDianTag: "DH_31", isNeedLoading: true },
|
|
{ desc: "DH_32", gameType: GameType.DH_32, bundleName: "DH_32", prefabUrl: "DH_32", dadianTag: "DH_32", wanjiaDaDianTag: "DH_32", isNeedLoading: true },
|
|
{ desc: "DH_33", gameType: GameType.DH_33, bundleName: "DH_33", prefabUrl: "DH_33", dadianTag: "DH_33", wanjiaDaDianTag: "DH_33", isNeedLoading: true },
|
|
{ desc: "DH_34", gameType: GameType.DH_34, bundleName: "DH_34", prefabUrl: "DH_34", dadianTag: "DH_34", wanjiaDaDianTag: "DH_34", isNeedLoading: true },
|
|
]
|
|
|
|
export default class PrefabManage {
|
|
public static isEntering: boolean = false
|
|
public static curGameId: number = -1
|
|
public static curGameGameType: number = 0
|
|
public static loadingPrefab = null
|
|
public static NodeArray = ['主场景']
|
|
|
|
public static DadianListGame = []
|
|
static timeOutHideLoad = null;
|
|
|
|
/**
|
|
* 加载prefab
|
|
* @param gameType
|
|
* @param parentNode
|
|
* @param callFunc
|
|
* @param bMultiPopPrefab 可以多次同时弹出prefab
|
|
* @returns
|
|
*/
|
|
|
|
public static loadPrefabByType(gameType, parentNode = null, callFunc = null, bMultiPopPrefab = false) {
|
|
// console.log(gameType, 'loadPrefabByType gameType+++===')
|
|
// let loadtime = DateUtils.getNowTime_custom()
|
|
let bundleName = ''
|
|
let isNeedReleaseBundle = false
|
|
let customCallFunc = (prefabNode) => {
|
|
// let loadFinishtime = DateUtils.getNowTime_custom()
|
|
callFunc && callFunc(prefabNode)
|
|
//this.isEntering = false
|
|
let gameName = this.getPrefabInfoByGameType(gameType).desc
|
|
if (prefabNode.getComponent(GameBase)) {
|
|
prefabNode.getComponent(GameBase).setCurGameName(gameName)
|
|
prefabNode.getComponent(GameBase).setCurGameBundle(bundleName, isNeedReleaseBundle)
|
|
}
|
|
|
|
if (gameType == GameType.Loading) {
|
|
|
|
} else {
|
|
//游戏进入打点
|
|
console.log(gameName, '游戏进入++=====gameType+++===')
|
|
// if((loadFinishtime-loadtime)/1000>0){
|
|
// GameReport.LoadTimeReport((loadFinishtime-loadtime)/1000, gameName)
|
|
// }
|
|
Common5.curGameName = gameName
|
|
|
|
}
|
|
this.showLoading(false)
|
|
}
|
|
|
|
|
|
for (var i = 0; i < AllPrefabConfig.length; i++) {
|
|
if (gameType == AllPrefabConfig[i].gameType) {
|
|
|
|
bundleName = AllPrefabConfig[i].bundleName
|
|
if (AllPrefabConfig[i].isNeedReleaseBundle) {
|
|
isNeedReleaseBundle = true
|
|
}
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
|
|
//打点
|
|
if (AllPrefabConfig[i].dadianTag && AllPrefabConfig[i].dadianTag != '') {
|
|
|
|
Common5.ReportDY("inLevel", `任务${mainId}-` + AllPrefabConfig[i].dadianTag);
|
|
}
|
|
let dateDadian = User.getDadianListGame()
|
|
if (AllPrefabConfig[i].wanJiaDaDianTag && AllPrefabConfig[i].wanJiaDaDianTag != '' && !dateDadian[AllPrefabConfig[i].wanJiaDaDianTag]) {
|
|
//console.log('逆袭剧场++++++++++++++++++====')
|
|
User.setDadianListGame(AllPrefabConfig[i].wanJiaDaDianTag, true)
|
|
Common5.ReportDY("inLevel", `任务${mainId}-` + AllPrefabConfig[i].wanJiaDaDianTag);
|
|
}
|
|
|
|
this.curGameGameType = AllPrefabConfig[i].gameType
|
|
this.showLoading(false)
|
|
if (AllPrefabConfig[i].isNeedLoading) {
|
|
this.showLoading(true)
|
|
|
|
}
|
|
|
|
let subres = cc.assetManager.getBundle(bundleName);
|
|
if (subres) {
|
|
console.log('不加载bundle', bundleName)
|
|
Common5.getPrefabFromBundlePrefabLayer(bundleName, AllPrefabConfig[i].prefabUrl, parentNode, customCallFunc)
|
|
} else {
|
|
console.log('加载bundle', bundleName)
|
|
cc.assetManager.loadBundle(bundleName, function (err: Error, bundle: cc.AssetManager.Bundle) {
|
|
// console.log(bundleName, 'bundleName++==')
|
|
if (err) {
|
|
console.log(err)
|
|
return
|
|
}
|
|
Common5.getPrefabFromBundlePrefabLayer(bundleName, AllPrefabConfig[i].prefabUrl, parentNode, customCallFunc)
|
|
});
|
|
}
|
|
|
|
if (AllPrefabConfig[i].cityNodeName) {
|
|
User.subUnLockGameNameTab(AllPrefabConfig[i].cityNodeName)
|
|
}
|
|
|
|
return
|
|
}
|
|
}
|
|
}
|
|
|
|
//预加载prefab
|
|
public static preloadPrefabByType(gameType) {
|
|
for (var i = 0; i < AllPrefabConfig.length; i++) {
|
|
if (gameType == AllPrefabConfig[i].gameType) {
|
|
let bundleName = AllPrefabConfig[i].bundleName
|
|
let subres = cc.assetManager.getBundle(bundleName);
|
|
if (subres) {
|
|
console.log('不加载bundle22')
|
|
subres.preload(AllPrefabConfig[i].prefabUrl, cc.Prefab, () => {
|
|
console.log(AllPrefabConfig[i].desc, "预加载完成")
|
|
})
|
|
} else {
|
|
console.log('加载bundle22' + bundleName)
|
|
cc.assetManager.loadBundle(bundleName, function (err: Error, bundle: cc.AssetManager.Bundle) {
|
|
let bundle1 = cc.assetManager.getBundle(bundleName)
|
|
bundle1.preload(AllPrefabConfig[i].prefabUrl, cc.Prefab, () => {
|
|
console.log(AllPrefabConfig[i].desc, "预加载完成")
|
|
})
|
|
});
|
|
}
|
|
|
|
|
|
|
|
break
|
|
}
|
|
}
|
|
}
|
|
public static preloadPrefabArray(PrefabArray) {
|
|
let prefabIndex = 0
|
|
let preloadCallFunc = (index) => {
|
|
if (index >= PrefabArray.length) {
|
|
return
|
|
}
|
|
for (var i = 0; i < AllPrefabConfig.length; i++) {
|
|
if (PrefabArray[index] == AllPrefabConfig[i].gameType) {
|
|
|
|
let bundle = cc.assetManager.getBundle(AllPrefabConfig[i].bundleName)
|
|
if (bundle) {
|
|
bundle.preload(AllPrefabConfig[i].prefabUrl, cc.Prefab, () => {
|
|
console.log(AllPrefabConfig[i].desc, "预加载完成Array")
|
|
preloadCallFunc(++prefabIndex)
|
|
|
|
})
|
|
} else {
|
|
let configDate = AllPrefabConfig[i]
|
|
let self = this
|
|
cc.assetManager.loadBundle(configDate.bundleName, function (err: Error, bundle: cc.AssetManager.Bundle) {
|
|
let bundle1 = cc.assetManager.getBundle(configDate.bundleName)
|
|
bundle1.preload(configDate.prefabUrl, cc.Prefab, () => {
|
|
console.log(configDate.desc, "预加载完成Array")
|
|
preloadCallFunc(++prefabIndex)
|
|
})
|
|
});
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
}
|
|
preloadCallFunc(prefabIndex)
|
|
}
|
|
//预加载所有prefab
|
|
public static preloadAllPrefab() {
|
|
let prefabIndex = 0
|
|
let preloadCallFunc = (index) => {
|
|
if (index >= AllPrefabConfig.length) {
|
|
return
|
|
}
|
|
let bundle = cc.assetManager.getBundle(AllPrefabConfig[index].bundleName)
|
|
bundle.preload(AllPrefabConfig[index].prefabUrl, cc.Prefab, () => {
|
|
|
|
preloadCallFunc(++prefabIndex)
|
|
})
|
|
}
|
|
preloadCallFunc(prefabIndex)
|
|
}
|
|
//获取prefab信息
|
|
public static getPrefabInfoByGameType(gameType) {
|
|
for (var i = 0; i < AllPrefabConfig.length; i++) {
|
|
if (gameType == AllPrefabConfig[i].gameType) {
|
|
return AllPrefabConfig[i]
|
|
}
|
|
}
|
|
}
|
|
|
|
//获取prefab的Name
|
|
public static getPrefabNameByGameType(gameType) {
|
|
for (var i = 0; i < AllPrefabConfig.length; i++) {
|
|
if (gameType == AllPrefabConfig[i].gameType) {
|
|
return AllPrefabConfig[i].desc
|
|
}
|
|
}
|
|
}
|
|
|
|
//当前游戏名字
|
|
public static getCurGameNameTypeByType() {
|
|
//this.curGameGameType
|
|
let type_ = PrefabManage.getCurGameGameType()
|
|
let configs = PrefabManage.getPrefabInfoByGameType(type_)
|
|
return configs.desc
|
|
|
|
}
|
|
|
|
public static getNodeArray() {
|
|
return this.NodeArray
|
|
}
|
|
|
|
public static setNodeArray(NodeArray) {
|
|
this.NodeArray = NodeArray
|
|
}
|
|
//当前游戏id
|
|
public static getCurGameGameType() {
|
|
return this.curGameGameType
|
|
}
|
|
|
|
//当前游戏id
|
|
public static getCurGameId() {
|
|
return this.curGameId
|
|
}
|
|
//通用提示文字
|
|
public static showTextTips(contentStr, index = 1) {
|
|
let callFun = () => {
|
|
Common5.commonTextTipNode.getComponent(CommonTextTips).initView(contentStr)
|
|
}
|
|
if (!Common5.commonTextTipNode || !Common5.commonTextTipNode.parent) {
|
|
this.loadPrefabByType(GameType.CommonTextTips, cc.director.getScene().getChildByName("Canvas").getChildByName('prefabLayer2'), (prefabNode) => {
|
|
Common5.commonTextTipNode = prefabNode
|
|
callFun()
|
|
})
|
|
} else {
|
|
callFun()
|
|
}
|
|
|
|
}
|
|
public static showSpecialTextTips(contentStr, callFunc = null, parentNode = null) {
|
|
this.loadPrefabByType(GameType.SpecialTipsView, parentNode, (prefabNode) => {
|
|
prefabNode.getComponent(SpecialTipsView).initView(contentStr, callFunc)
|
|
})
|
|
}
|
|
//金币飞动效果
|
|
public static showMoneyFlyEffect(startNode, endNode?, money?) {
|
|
|
|
let canvas = cc.find('Canvas')
|
|
let moneyFlyLayer = canvas.getChildByName("moneyFlyLayer")
|
|
if (!moneyFlyLayer) {
|
|
return
|
|
}
|
|
|
|
let script_: MoneyFlyEffect = moneyFlyLayer.getComponent('MoneyFlyEffect')
|
|
script_.playAnim(startNode, money)
|
|
}
|
|
|
|
public static showGoldFlyEffect(startNode) {
|
|
let canvas = cc.find('Canvas')
|
|
let goldFlyLayer = canvas.getChildByName("goldFlyLayer")
|
|
if (!goldFlyLayer) {
|
|
return
|
|
}
|
|
|
|
let script_: MoneyFlyEffect = goldFlyLayer.getComponent('MoneyFlyEffect')
|
|
script_.playAnim(startNode)
|
|
}
|
|
|
|
|
|
public static getGameTypeByName(name) {
|
|
for (var i = 0; i < AllPrefabConfig.length; i++) {
|
|
if (AllPrefabConfig[i].desc == name) {
|
|
return AllPrefabConfig[i].gameType
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
public static showLoading(isShow) {
|
|
//console.log('showLoading')
|
|
if (cc.isValid(cc.director.getScene())) {
|
|
let Canvas = cc.director.getScene().getChildByName("Canvas")
|
|
if (cc.isValid(Canvas)) {
|
|
let loadLayer = Canvas.getChildByName('loadLayer')
|
|
if (loadLayer) {
|
|
loadLayer.active = isShow
|
|
// if(isShow == false){
|
|
// if(this.timeOutHideLoad!=null){
|
|
// clearTimeout(this.timeOutHideLoad);
|
|
// this.timeOutHideLoad=null
|
|
// }
|
|
|
|
// }
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
//花钱效果
|
|
public static spendMoneyEffect(startNode) {
|
|
let canvas = cc.find('Canvas')
|
|
let moneyLayer = canvas.getChildByName("moneyLayer")
|
|
if (!moneyLayer) {
|
|
return
|
|
}
|
|
let chaopiao1 = moneyLayer.getChildByName('chaopiao')
|
|
let chaopiao = cc.instantiate(chaopiao1)
|
|
chaopiao.parent = chaopiao1.parent
|
|
Common5.setNodeToTargetPos(chaopiao, startNode)
|
|
chaopiao.getComponent(sp.Skeleton).setAnimation(0, 'baoqian', false)
|
|
chaopiao.getComponent(sp.Skeleton).setCompleteListener(() => {
|
|
chaopiao.removeFromParent()
|
|
chaopiao.destroy()
|
|
})
|
|
}
|
|
|
|
//黑屏过渡效果
|
|
public static showBlackGuoDu(callback?, endCallBack?, str?) {
|
|
let func = () => {
|
|
Common5.blackGuoduNode.opacity = 0
|
|
if (str) {
|
|
Common5.blackGuoduNode.getChildByName("str").getComponent(cc.Label).string = str
|
|
} else {
|
|
Common5.blackGuoduNode.getChildByName("str").getComponent(cc.Label).string = ''
|
|
}
|
|
cc.tween(Common5.blackGuoduNode)
|
|
.sequence(
|
|
cc.tween().to(2, { opacity: 255 }),
|
|
cc.tween().call(() => {
|
|
if (callback) {
|
|
callback()
|
|
}
|
|
}),
|
|
cc.tween().to(2, { opacity: 0 }),
|
|
cc.tween().call(() => {
|
|
if (endCallBack) {
|
|
endCallBack()
|
|
}
|
|
}),
|
|
)
|
|
.start()
|
|
}
|
|
if (!Common5.blackGuoduNode || !Common5.blackGuoduNode.parent) {
|
|
this.loadPrefabByType(GameType.blackGuoDu, cc.director.getScene().getChildByName("Canvas").getChildByName('prefabLayer2'), (prefabNode) => {
|
|
Common5.blackGuoduNode = prefabNode
|
|
func()
|
|
})
|
|
} else {
|
|
func()
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|