消消方块阵换皮表情
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.

615 lines
25 KiB

1 week ago
import { AudioClip, Prefab, SpriteFrame, sys } from "cc";
import { IUIConfig, UILayer } from "../../mx/module/ui/UIManager";
import { ResInfo, ResPakage } from "../../mx/module/res/ResourcesManager";
import { ChapterNewPlayTypeEnum } from "./ChapterPlayTypes";
import { BattleType } from "../manager/ChapterDataManager";
import { DEBUG, EDITOR } from "cc/env";
/**bundle定义 */
export enum GBundle {
/**首包(不可删除,不要修改) */
First = "first",
/**公共资源,进游戏就加载永远不卸载的资源包 */
Comm = "comm",
/**公共资源,动态资源 */
Comm2 = "comm2",
/**道具图标 */
Items = "icons",
/**游戏音效 */
Audio = "audio",
/**首页 */
Home = "home",
/**游戏 */
Game = "game",
/**投诉 */
Complain = "complain",
/**侧边栏 */
Sidebar = "sidebar",
/**设置 */
Settings = "settings",
/**获得 */
GetReward = "getReward",
/**商店 */
Shop = "shop",
/**角色 */
Role = "role",
/**武器 */
Weapon = "weapon",
/**副本 */
Replica = "replica",
/**战斗地图 */
BattleMap = 'battleMap',
/**战斗中弹框 */
BattleGameResult = 'battleGameResult',
/**战斗地图提示 */
BattleGameMapTip = 'battleGameMapTip',
/**战斗中武器 */
BattleGameWeapon = 'battleGameWeapon',
/**战斗中怪物 */
BattleGameMonster = 'battleGameMonster',
/**武器升级 */
WeaponLevelUp = 'weaponLevelUp',
/**转盘抽奖 */
TurnTable = 'turnTable',
/**技能/武器3选1 */
SkillSelect = 'SkillSelect',
/**签到 */
sign7Day = 'sign7Day',
/**任务 */
taskView = 'taskView',
/**购买体力 */
buyPower = 'buyPower',
/**扫荡 */
wipeOut = 'wipeOut',
/**选择难度 */
selectDifficult = 'selectDifficult',
/**跳转游戏等级 */
jumpGameLevel = 'jumpGameLevel',
/**新机制 */
newMechanism = 'newMechanism',
/**武器碎片 */
WeaponSuiPian = 'WeaponSuiPian',
1 week ago
/**皮肤 */
PopSkin = 'popSkin',
1 week ago
/**更新公告 */
PopNotice = 'popNotice',
/**月卡 */
PopMonthCard = 'giftMonth',
/**首充礼包 */
FirstRecharge = 'firstRecharge',
/**连续购买 */
ContinuouslyBag = 'continuouslyBag',
/**基金 */
PopFund = 'fund',
/**章节奖励 */
ChapterGiftBg = 'chapterGift',
/**钻石商店 */
DiamondShop = 'diamondShop',
/**pops */
PopAndTips = 'popAndTips',
mechanismEffect = 'mechanismEffect', //新机制特效
1 week ago
skinLevel = 'skinLevel', //皮肤等级
1 week ago
storyComic = 'storyComic', //故事漫画
storyDialog = 'storyDialog', //故事对话
/**宠物 */
Pet = 'petLevel',
/**丧尸 */
Zombie = 'zombieGame',
greatGift = 'greatGift',
/**吸引流量游戏 */
gaoyaguo = 'gaoyaguo',
atGameResult = 'atGameResult',
atGameChoose = 'atGameChoose',
tantantan = 'tantantan',
/**俄罗斯方块卡片 */
tetriCards = 'tetriCards',
/**俄罗斯方块游戏 */
tetriGame = 'tetriGame',
/**俄罗斯方块地图 */
tetriMap = 'tetriMap',
/**俄罗斯方块武器 */
tetriWeapon = 'tetriWeapon',
/**俄罗斯方块玩法说明 */
tetriDoc = 'tetriDoc',
/**救救我鸭 */
jiujiuwoya = 'jiujiuwoya',
/**救救我鸭方块*/
jiujiuwoyaCard = 'jiujiuwoyaCard',
}
/**资源路径配置 */
export class GPath {
/**UI预制体 */
static UIPrefab = "prefab/";
/**普通预制体 */
static Prefab = "prefab/";
/**音频 */
static Audio = "sound/";
/**texture文件夹资源 */
static texture(name: string | number) { return "texture/" + name; }
/**主页图片资源 */
static Home(name: string | number) { return "texture/main/" + name; }
/**道具图标 */
static Item(name: string | number) { return "item/" + name; }
1 week ago
/**角色手部图标(icons/hand) */
static Hand(name: string | number) { return "hand/" + name; }
1 week ago
/**道具图标 */
static SkillItem(name: string | number) { return "skillItem/" + name; }
/**武器类型图标 */
static WeaponType(name: string | number) { return "texture/武器类型/" + name; }
/**武器底 */
static WeaponBottom(name: string | number) { return "texture/" + name; }
/**武器升级 */
static WeaponLevelUp(name: string | number) { return "texture/" + name; }
/**技能/武器3选1 */
static SkillSelect(name: string | number) { return "texture/" + name; }
/**转盘 */
static TurnTableRogue(name: string | number) { return "texture/" + name; }
/**障碍物 */
static ObstacleItem(name: string | number) { return "texture/摆放路障/" + name; }
/**障碍物预制体 */
static ObstaclePrefab(name: string | number) { return "prefab/障碍物/" + name; }
/**boss血条 */
static BossHpProgress(name: string | number) { return "texture/BOSS血条/" + name; }
//品级
static PingjiKuang(name: string | number) { return "texture/imgs/" + name; }
/**障碍物图标 */
static ObstacleIcon3(name: string | number) { return "obstacle3/" + name; }
//等级横图标
static LevelUpIconH(name: string | number) { return "img/" + name; }
//等级竖图标
static LevelUpIconV(name: string | number) { return "img/" + name; }
//战斗伤害统计图片
static DamageStatistics(name: string) { return "texture/战斗统计功能/" + name; }
1 week ago
/**选择皮肤图片 */
static PopSkin(name: string) { return "pic/skin_" + name; }
//选择皮肤
static SelectSkin(name: string) { return "texture/skin_" + name; }
1 week ago
static Comm2Texture(name: string) { return "texture/imgs/" + name; }
//螺丝图片
static LuosiDingTex(name: string) { return "texture/螺丝/螺丝" + name; }
}
/**UI面板配置 */
export enum UIID {
/**等待图标 */
WatiIcon = 100,
/**首页 */
Home = 101,
/**2D游戏UI */
Game = 102,
/**游戏结束 */
GameEnd = 103,
/**设置 */
Settings = 104,
/**投诉 */
Complain = 105,
/**侧边栏 */
Sidebar = 106,
/**领取奖励弹窗 */
GetReward = 107,
/**消息框 */
Msg = 108,
/**消息确认框 */
MsgBox = 109,
/**主界面 */
MainUI = 111,
/**商店 */
Shop = 200,
/**角色页面 */
Role = 201,
/**武器页面 */
Weapon = 203,
/**副本页面 */
Replica = 204,
/**微信聊天 */
WXChat = 301,
/**选择结果弹窗 */
SelectResultPop = 30101,
/**剧情 */
StoryLine = 401,
/**财经新闻 */
FinanceNews = 402,
/**引导剧情 */
StoryGuide = 404,
/**道具不足跳转弹窗 */
SkipPop = 508,
/**战斗游戏界面 */
BattleGame = 601,
/**武器升级界面 */
WeaponLevelUp = 602,
/**转盘抽奖界面 */
TurnTable = 603,
/**战斗成功 */
BattleSuccess = 605,
/**战斗失败 */
BattleFail = 606,
/**战斗复活 */
BattleRevive = 607,
/**战斗暂停 */
BattlePause = 608,
/**宝箱升级详情 */
boxLevelupDetail = 609,
/**道具详情 */
ItemDetailBox = 610,
/**购买道具框 */
buyItemBox = 611,
/**签到7天 */
sign7Day = 612,
/**任务界面 */
taskView = 613,
/**道具详情 */
ItemDetailBox2 = 614,
/**等级升级 */
pageUserLevelup = 615,
/**新机制引导遮罩 */
NewGuideMask = 616,
/**等级升级详情 */
pageUserLevelupDetail = 617,
/**地图提示 */
BattleMapTip = 618,
/**购买体力 */
buyPower = 619,
/**清除地图 */
wipeOut = 620,
/**增加金币弹框 */
BattleGetCoin = 621,
/**领取新道具弹窗 */
GetNewGoodid = 622,
/**副本宝箱 */
ReplicaBox = 623,
/**选择难度 */
selectDifficult = 624,
/**跳转游戏等级 */
jumpGameLevel = 625,
/**CDK面板 */
PanelCDK = 626,
/**新机制 */
newMechanism = 627,
/**武器碎片 */
WeaponSuiPian = 628,
/**武器模型 */
GetNewModel = 629,
/**挑战提示 */
challengeTip = 630,
/**继续上次战斗 */
ContinueLastBattle = 631,
1 week ago
/**选择皮肤 */
PopSkin = 632,
1 week ago
/**更新公告 */
PopNotice = 633,
/**月卡 */
PopMonthCard = 634,
/**首充礼包 */
PopFirstRecharge = 635,
/**连续购买 */
PopContinuouslyBag = 636,
/**基金 */
PopFund = 637,
1 week ago
/**新年签到 */
SignNewYear = 638,
/**皮肤等级 */
skinLevel = 639,
1 week ago
/**故事漫画弹窗 */
storyComic = 640,
/**故事对话弹窗 */
storyDialog = 641,
/**宠物等级 */
petIntroduction = 642,
/**宠物等级弹窗 */
petLevel = 643,
petLayer = 644,
/**修复界面 */
xiufuBox = 645,
/**丧尸主界面 */
zombieLayer = 646,
/**丧尸农场 */
zombieFarm = 647,
/**丧尸工厂 */
zombieFactory = 648,
/**丧尸矿产 */
zombieMine = 649,
/**丧尸升级提示 */
zombieUpgradeTip = 650,
/**技能选择 */
SkillSelect = 651,
greatGift = 652,
/**吸引流量游戏 */
Gaoyaguo = 653,
failAtGameResult = 654,
successAtGameResult = 655,
atGameChoose = 656,
/**解锁按钮 */
PopUnLockBtn = 657,
/**吸引流量游戏 */
tantantan1 = 658,
tantantan2 = 659,
tantantan3 = 660,
/**解锁新功能 */
GetNewFun = 661,
//新增雇佣收益
hireIncome = 662,
/** 俄罗斯方块游戏*/
TetriGame = 663,
/**俄罗斯方块玩法说明 */
TetriDoc = 664,
/**GM存档编辑器 */
PopGM = 665,
/**救救我鸭 */
jiujiuwoyaGame = 666,
}
/**UI资源配置 */
export const UIConfigs: { [key: number]: IUIConfig } = {
[UIID.WatiIcon]: { desc: "等待图标", layer: UILayer.Loading, bundle: GBundle.Comm, path: GPath.UIPrefab, name: "waitIcon" },
[UIID.Home]: { desc: "首页", layer: UILayer.MainUI, bundle: GBundle.Home, path: GPath.UIPrefab, name: "PanelHome" },
[UIID.MainUI]: { desc: "主界面", layer: UILayer.Menu, bundle: GBundle.Comm2, path: GPath.UIPrefab, name: "MainUI" },
[UIID.Game]: { desc: "2D游戏UI", layer: UILayer.Game2D, bundle: GBundle.Game, path: GPath.UIPrefab, name: "PanelGame" },
[UIID.GameEnd]: { desc: "游戏结束", layer: UILayer.Page, bundle: GBundle.Game, path: GPath.UIPrefab, name: "PanelGameEnd" },
[UIID.Settings]: { desc: "设置", layer: UILayer.Pop, bundle: GBundle.Settings, path: GPath.UIPrefab, name: "PanelSettings" },
[UIID.PanelCDK]: { desc: "CDK面板", layer: UILayer.Pop, bundle: GBundle.Settings, path: GPath.UIPrefab, name: "PanelCDK" },
[UIID.Complain]: { desc: "投诉", layer: UILayer.Pop, bundle: GBundle.Complain, path: GPath.UIPrefab, name: "PanelComplain" },
[UIID.Sidebar]: { desc: "侧边栏", layer: UILayer.Pop, bundle: GBundle.Sidebar, path: GPath.UIPrefab, name: "PanelSidebar" },
[UIID.GetReward]: { desc: "领取奖励弹窗", layer: UILayer.Pop, bundle: GBundle.GetReward, path: GPath.UIPrefab, name: "GetReward" },
[UIID.Msg]: { desc: "消息框", layer: UILayer.Loading, bundle: GBundle.First, path: GPath.UIPrefab, name: "msg" },
[UIID.MsgBox]: { desc: "消息确认框", layer: UILayer.Pop, bundle: GBundle.PopAndTips, path: GPath.UIPrefab, name: "MsgBox" },
//在此新增UI面板配置
[UIID.Shop]: { desc: "商店", layer: UILayer.MainUI, bundle: GBundle.Shop, path: GPath.UIPrefab, name: "pageShop" },
[UIID.Role]: { desc: "角色页面", layer: UILayer.MainUI, bundle: GBundle.Role, path: GPath.UIPrefab, name: "pageRole" },
[UIID.Weapon]: { desc: "武器页面", layer: UILayer.MainUI, bundle: GBundle.Weapon, path: GPath.UIPrefab, name: "pageWeapon" },
[UIID.Replica]: { desc: "副本页面", layer: UILayer.MainUI, bundle: GBundle.Replica, path: GPath.UIPrefab, name: "Replica" },
[UIID.WeaponLevelUp]: { desc: "武器升级界面", layer: UILayer.Page, bundle: GBundle.WeaponLevelUp, path: GPath.UIPrefab, name: "WeaponLevelUp" },
[UIID.TurnTable]: { desc: "转盘抽奖界面", layer: UILayer.Pop, bundle: GBundle.TurnTable, path: GPath.UIPrefab, name: "TurnTable" },
[UIID.BattleSuccess]: { desc: "战斗成功", layer: UILayer.Pop, bundle: GBundle.BattleGameResult, path: GPath.UIPrefab, name: "BattleSuccess" },
[UIID.BattleFail]: { desc: "战斗失败", layer: UILayer.Pop, bundle: GBundle.BattleGameResult, path: GPath.UIPrefab, name: "BattleFail" },
[UIID.BattleRevive]: { desc: "战斗复活", layer: UILayer.Pop, bundle: GBundle.BattleGameResult, path: GPath.UIPrefab, name: "BattleRevive" },
[UIID.BattlePause]: { desc: "战斗暂停", layer: UILayer.Pop, bundle: GBundle.BattleGameResult, path: GPath.UIPrefab, name: "BattlePause" },
[UIID.BattleMapTip]: { desc: "地图提示", layer: UILayer.Pop, bundle: GBundle.BattleGameMapTip, path: GPath.UIPrefab, name: "BattleMapTip" },
[UIID.BattleGetCoin]: { desc: "增加金币弹框", layer: UILayer.Pop, bundle: GBundle.BattleGameResult, path: GPath.UIPrefab, name: "BattleGetCoin" },
[UIID.boxLevelupDetail]: { desc: "宝箱升级详情", layer: UILayer.Pop, bundle: GBundle.Shop, path: GPath.UIPrefab, name: "boxLevelupDetail" },
[UIID.ItemDetailBox]: { desc: "道具详情", layer: UILayer.Pop, bundle: GBundle.PopAndTips, path: GPath.UIPrefab, name: "ItemDetailBox" },
[UIID.ItemDetailBox2]: { desc: "道具详情2", layer: UILayer.Pop, bundle: GBundle.PopAndTips, path: GPath.UIPrefab, name: "ItemDetailBox2" },
[UIID.buyItemBox]: { desc: "购买道具框", layer: UILayer.Pop, bundle: GBundle.Shop, path: GPath.UIPrefab, name: "buyItemBox" },
[UIID.sign7Day]: { desc: "签到7天", layer: UILayer.Pop, bundle: GBundle.sign7Day, path: GPath.UIPrefab, name: "sign7Day" },
[UIID.taskView]: { desc: "任务界面", layer: UILayer.Pop, bundle: GBundle.taskView, path: GPath.UIPrefab, name: "taskView" },
[UIID.pageUserLevelup]: { desc: "用户等级升级", layer: UILayer.Pop, bundle: GBundle.Role, path: GPath.UIPrefab, name: "pageUserLevelup" },
[UIID.NewGuideMask]: { desc: "新手指引遮罩", layer: UILayer.Guide, bundle: GBundle.Comm2, path: GPath.UIPrefab, name: "NewGuideMask" },
[UIID.pageUserLevelupDetail]: { desc: "等级升级详情", layer: UILayer.Pop, bundle: GBundle.Role, path: GPath.UIPrefab, name: "pageUserLevelupDetail" },
[UIID.buyPower]: { desc: "购买体力", layer: UILayer.Pop, bundle: GBundle.buyPower, path: GPath.UIPrefab, name: "buyPower" },
[UIID.wipeOut]: { desc: "清除地图", layer: UILayer.Pop, bundle: GBundle.wipeOut, path: GPath.UIPrefab, name: "wipeOut" },
[UIID.GetNewGoodid]: { desc: "领取新道具弹窗", layer: UILayer.Pop, bundle: GBundle.GetReward, path: GPath.UIPrefab, name: "GetNewGoodid" },
[UIID.ReplicaBox]: { desc: "地牢宝箱", layer: UILayer.Pop, bundle: GBundle.Replica, path: GPath.UIPrefab, name: "ReplicaBox" },
/**选择难度 */
[UIID.selectDifficult]: { desc: "选择难度", layer: UILayer.Pop, bundle: GBundle.selectDifficult, path: GPath.UIPrefab, name: "selectDifficult" },
/**跳转游戏关卡 */
[UIID.jumpGameLevel]: { desc: "跳转游戏关卡", layer: UILayer.Pop, bundle: GBundle.jumpGameLevel, path: GPath.UIPrefab, name: "jumpGameLevel" },
/**新机制弹窗 */
[UIID.newMechanism]: { desc: "新机制弹窗", layer: UILayer.Pop, bundle: GBundle.newMechanism, path: GPath.UIPrefab, name: "newMechanism" },
/**武器随机应变弹窗 */
[UIID.WeaponSuiPian]: { desc: "武器随机应变弹窗", layer: UILayer.Pop, bundle: GBundle.WeaponSuiPian, path: GPath.UIPrefab, name: "WeaponSuiPian" },
/**获取新模型弹窗 */
[UIID.GetNewModel]: { desc: "获取新模型弹窗", layer: UILayer.Pop, bundle: GBundle.GetReward, path: GPath.UIPrefab, name: "GetNewModel" },
/**挑战提示弹窗 */
[UIID.challengeTip]: { desc: "挑战提示弹窗", layer: UILayer.Pop, bundle: GBundle.PopAndTips, path: GPath.UIPrefab, name: "challengeTip" },
/**继续上次战斗弹窗 */
[UIID.ContinueLastBattle]: { desc: "继续上次战斗弹窗", layer: UILayer.Pop, bundle: GBundle.PopAndTips, path: GPath.UIPrefab, name: "continueLastBattle" },
1 week ago
/**选择皮肤弹窗 */
[UIID.PopSkin]: { desc: "选择皮肤弹窗", layer: UILayer.Pop, bundle: GBundle.PopSkin, path: GPath.UIPrefab, name: "PopSkin" },
1 week ago
/**更新公告弹窗 */
[UIID.PopNotice]: { desc: "更新公告弹窗", layer: UILayer.Pop, bundle: GBundle.PopNotice, path: GPath.UIPrefab, name: "PopNotice" },
/**月卡弹窗 */
[UIID.PopMonthCard]: { desc: "月卡弹窗", layer: UILayer.Page, bundle: GBundle.PopMonthCard, path: GPath.UIPrefab, name: "PopGiftmonth" },
/**首充礼包弹窗 */
[UIID.PopFirstRecharge]: { desc: "首充礼包弹窗", layer: UILayer.Pop, bundle: GBundle.FirstRecharge, path: GPath.UIPrefab, name: "PopFirstRecharge" },
/**连续购买弹窗 */
[UIID.PopContinuouslyBag]: { desc: "连续购买弹窗", layer: UILayer.Pop, bundle: GBundle.ContinuouslyBag, path: GPath.UIPrefab, name: "PopContinuouslyBag" },
/**基金弹窗 */
[UIID.PopFund]: { desc: "基金弹窗", layer: UILayer.Pop, bundle: GBundle.PopFund, path: GPath.UIPrefab, name: "PopFund" },
1 week ago
/**新年签到弹窗 */
[UIID.SignNewYear]: { desc: "新年签到弹窗", layer: UILayer.Pop, bundle: GBundle.sign7Day, path: GPath.UIPrefab, name: "SignNewYear" },
/**皮肤等级弹窗 */
[UIID.skinLevel]: { desc: "皮肤等级弹窗", layer: UILayer.Pop, bundle: GBundle.skinLevel, path: GPath.UIPrefab, name: "skinLevel" },
1 week ago
/**故事漫画弹窗 */
[UIID.storyComic]: { desc: "故事漫画弹窗", layer: UILayer.Pop, bundle: GBundle.storyComic, path: GPath.UIPrefab, name: "storyComic" },
/**故事对话弹窗 */
[UIID.storyDialog]: { desc: "故事对话弹窗", layer: UILayer.Pop, bundle: GBundle.storyDialog, path: GPath.UIPrefab, name: "storyDialog" },
/**宠物升级弹窗 */
[UIID.petLevel]: { desc: "宠物等级弹窗", layer: UILayer.Pop, bundle: GBundle.Pet, path: GPath.UIPrefab, name: "petLevel" },
/**宠物弹窗 */
[UIID.petLayer]: { desc: "宠物弹窗", layer: UILayer.Pop, bundle: GBundle.Pet, path: GPath.UIPrefab, name: "petLayer" },
/**宠物概率弹窗 */
[UIID.petIntroduction]: { desc: "宠物概率弹窗", layer: UILayer.Pop, bundle: GBundle.Pet, path: GPath.UIPrefab, name: "petIntroduction" },
/**丧尸主界面 */
[UIID.zombieLayer]: { desc: "丧尸主界面", layer: UILayer.Pop, bundle: GBundle.Zombie, path: GPath.UIPrefab, name: "zombieLayer" },
/**丧尸农场 */
[UIID.zombieFarm]: { desc: "丧尸农场", layer: UILayer.Page, bundle: GBundle.Zombie, path: GPath.UIPrefab, name: "farmLayer" },
/**丧尸工厂 */
[UIID.zombieFactory]: { desc: "丧尸工厂", layer: UILayer.Page, bundle: GBundle.Zombie, path: GPath.UIPrefab, name: "factoryLayer" },
/**丧尸矿产 */
[UIID.zombieMine]: { desc: "丧尸矿产", layer: UILayer.Page, bundle: GBundle.Zombie, path: GPath.UIPrefab, name: "mineralLayer" },
/**丧尸升级提示 */
[UIID.zombieUpgradeTip]: { desc: "丧尸升级提示", layer: UILayer.Pop, bundle: GBundle.Zombie, path: GPath.UIPrefab, name: "levelTip" },
/**技能选择 */
[UIID.SkillSelect]: { desc: "技能选择", layer: UILayer.Pop, bundle: GBundle.SkillSelect, path: GPath.UIPrefab, name: "SkillSelect" },
/**超值礼包 */
[UIID.greatGift]: { desc: "超值礼包", layer: UILayer.Pop, bundle: GBundle.greatGift, path: GPath.UIPrefab, name: "greatGift" },
/**吸引流量游戏 */
[UIID.Gaoyaguo]: { desc: "吸引流量游戏", layer: UILayer.Pop, bundle: GBundle.gaoyaguo, path: GPath.UIPrefab, name: "Gaoyaguo" },
[UIID.failAtGameResult]: { desc: "失败", layer: UILayer.Pop, bundle: GBundle.atGameResult, path: GPath.UIPrefab, name: "fail" },
[UIID.successAtGameResult]: { desc: "成功", layer: UILayer.Pop, bundle: GBundle.atGameResult, path: GPath.UIPrefab, name: "success" },
[UIID.atGameChoose]: { desc: "选关", layer: UILayer.Pop, bundle: GBundle.atGameChoose, path: GPath.UIPrefab, name: "atGameChoose" },
/**解锁按钮 */
[UIID.PopUnLockBtn]: { desc: "解锁按钮", layer: UILayer.Pop, bundle: GBundle.Comm2, path: GPath.UIPrefab, name: "PopUnLockBtn" },
/**吸引流量游戏 */
[UIID.tantantan1]: { desc: "吸引流量游戏2", layer: UILayer.Pop, bundle: GBundle.tantantan, path: GPath.UIPrefab, name: "tantantan1" },
[UIID.tantantan2]: { desc: "吸引流量游戏3", layer: UILayer.Pop, bundle: GBundle.tantantan, path: GPath.UIPrefab, name: "tantantan2" },
[UIID.tantantan3]: { desc: "吸引流量游戏4", layer: UILayer.Pop, bundle: GBundle.tantantan, path: GPath.UIPrefab, name: "tantantan3" },
/**解锁新功能 */
[UIID.GetNewFun]: { desc: "解锁新功能", layer: UILayer.Pop, bundle: GBundle.GetReward, path: GPath.UIPrefab, name: "GetNewFun" },
[UIID.hireIncome]: { desc: "雇佣收益", layer: UILayer.Pop, bundle: GBundle.Zombie, path: GPath.UIPrefab, name: "hireIncome" },
[UIID.TetriGame]: { desc: "俄罗斯方块游戏", layer: UILayer.Page, bundle: GBundle.tetriGame, path: GPath.UIPrefab, name: "tetriGame" },
[UIID.TetriDoc]: { desc: "俄罗斯方块玩法说明", layer: UILayer.Pop, bundle: GBundle.tetriDoc, path: GPath.UIPrefab, name: "PopTetriDoc" },
[UIID.PopGM]: { desc: "GM存档编辑器", layer: UILayer.Pop, bundle: GBundle.Comm2, path: GPath.UIPrefab, name: "PopGM" },
[UIID.jiujiuwoyaGame]: { desc: "救救我鸭游戏", layer: UILayer.Page, bundle: GBundle.jiujiuwoya, path: GPath.UIPrefab, name: "jiujiuwoyaGame" },
}
/**资源包名 */
export const enum ResPkgName {
CommRes = "CommRes",
MainRes = "MainRes",
BattleRes = "BattleRes",
ZombieRes = "ZombieRes",
JiuJiuWoYaRes = "JiuJiuWoYaRes",
}
/**获取公共资源包 */
export const getCommResPakage: Function = () => {
let respkg: ResPakage = {
name: ResPkgName.CommRes,
isReleaseable: false,
ress: [
// { name: `gm`, bundle: GBundle.First, path: GPath.Prefab, type: Prefab },
{ name: `ItemGrid`, bundle: GBundle.Comm2, path: GPath.Prefab, type: Prefab },
],
}
if (EDITOR || DEBUG || sys.isBrowser) {
respkg.ress.push({ name: `gm`, bundle: GBundle.First, path: GPath.Prefab, type: Prefab });
}
return respkg;
}
/**主场景资源包 */
export const getMainResPakage: Function = () => {
let respkg: ResPakage = {
name: ResPkgName.MainRes,
isReleaseable: true,
ress: [
],
}
return respkg;
}
export const getZombieResPakage: Function = () => {
let respkg: ResPakage = {
name: ResPkgName.ZombieRes,
isReleaseable: true,
ress: [
{ name: `farmLayer`, bundle: GBundle.Zombie, path: GPath.Prefab, type: Prefab },
],
}
//17章加入丧尸工厂
if (gg.data.doc.chapter >= 10) {
respkg.ress.push({ name: `factoryLayer`, bundle: GBundle.Zombie, path: GPath.Prefab, type: Prefab });
}
//17章加入丧尸矿场
if (gg.data.doc.chapter >= 16) {
respkg.ress.push({ name: `mineralLayer`, bundle: GBundle.Zombie, path: GPath.Prefab, type: Prefab });
}
// { name: 'ui_baseInfo', bundle: GBundle.Comm2, path: `prefab/`, type: Prefab },
// { name: 'btnArray', bundle: GBundle.Zombie, path: `prefab/`, type: Prefab },
// { name: 'incomeKuang', bundle: GBundle.Zombie, path: `prefab/`, type: Prefab },
// { name: 'leijiKuang', bundle: GBundle.Zombie, path: `prefab/`, type: Prefab },
respkg.ress.push({ name: 'ui_baseInfo', bundle: GBundle.Comm2, path: `prefab/`, type: Prefab });
respkg.ress.push({ name: 'btnArray', bundle: GBundle.Zombie, path: `prefab/`, type: Prefab });
respkg.ress.push({ name: 'incomeKuang', bundle: GBundle.Zombie, path: `prefab/`, type: Prefab });
respkg.ress.push({ name: 'leijiKuang', bundle: GBundle.Zombie, path: `prefab/`, type: Prefab });
return respkg;
}
/**获取救救我鸭资源包 */
export const getJiuJiuWoYaResPakage: Function = () => {
let respkg: ResPakage = {
name: ResPkgName.JiuJiuWoYaRes,
isReleaseable: true,
ress: [
],
}
return respkg;
}
/** 按地图 ID 构造战斗地图资源项 */
export function getBattleMapResItem(mapId: number): ResInfo {
return {
name: `tetriMap${mapId}`,
bundle: GBundle.tetriMap,
path: 'prefab/',
type: Prefab,
};
}
/** 按章节 ID 获取战斗地图资源项(预载用,不依赖 CurentBattle) */
export function getBattleMapResItemByChapter(chapterID: number): ResInfo | null {
const chapterConfig = gg.data.project.getChapterConfig(chapterID);
if (!chapterConfig?.mapId) {
return null;
}
return getBattleMapResItem(chapterConfig.mapId);
}
/**获取战斗资源包:进局仅预加载地图,其余由 getNodeAsync / ensurePrefab 按需加载 + 对象池复用 */
export const getBattleResPakage: Function = () => {
let respkg: ResPakage = {
name: ResPkgName.BattleRes,
isReleaseable: true,
ress: [],
}
if (gg.game.CurentBattle) {
gg.game.CurentBattle.MonsterDropCoinAddRatio = 1
respkg.ress.push(getBattleMapResItem(gg.game.CurentBattle.MapId));
}
console.log("加载战斗地图资源:" + respkg.ress.length);
return respkg;
}