Commit 6ce3a256 authored by Friends233's avatar Friends233

测试面板

parent 0486f6a6
This diff is collapsed.
...@@ -24,15 +24,15 @@ const CLIP_STATE = { ...@@ -24,15 +24,15 @@ const CLIP_STATE = {
@ccclass @ccclass
export default class GameScene extends cc.Component { export default class GameScene extends cc.Component {
/** 单格进度条 */ /** 单格进度条 */
@property(cc.Prefab) @property({ type: cc.Prefab, displayName: '单格进度条' })
procItem: cc.Prefab = null procItem: cc.Prefab = null
/** 舞台道具 */ /** 舞台道具 */
@property([cc.Prefab]) @property({ type: [cc.Prefab], displayName: '舞台道具' })
propItem: cc.Prefab[] = [] propItem: cc.Prefab[] = []
/** 加分道具 */ /** 加分道具 */
@property(cc.Prefab) @property({ type: cc.Prefab, displayName: '加分道具' })
bsetPropItem: cc.Prefab = null bsetPropItem: cc.Prefab = null
/** 当前关卡 0、1、2... */ /** 当前关卡 0、1、2... */
...@@ -75,7 +75,7 @@ export default class GameScene extends cc.Component { ...@@ -75,7 +75,7 @@ export default class GameScene extends cc.Component {
/** 开启碰撞检测 */ /** 开启碰撞检测 */
const cm = cc.director.getCollisionManager() const cm = cc.director.getCollisionManager()
cm.enabled = true cm.enabled = true
cm.enabledDebugDraw = true; // cm.enabledDebugDraw = true;
} }
start() { start() {
...@@ -113,6 +113,22 @@ export default class GameScene extends cc.Component { ...@@ -113,6 +113,22 @@ export default class GameScene extends cc.Component {
gameBtn.on(cc.Node.EventType.TOUCH_END, this.playGame, this) gameBtn.on(cc.Node.EventType.TOUCH_END, this.playGame, this)
this.node.on(CUSTOM_EVENT.CLIP_ANI_END, this.onAnimCompleted, this) this.node.on(CUSTOM_EVENT.CLIP_ANI_END, this.onAnimCompleted, this)
this.node.on(CUSTOM_EVENT.CLIP_COLLISION, this.onCollEnter, this) this.node.on(CUSTOM_EVENT.CLIP_COLLISION, this.onCollEnter, this)
// TODO 测试用
const href = window?.location?.href
const isTest = href?.includes('duibadev') || href?.includes('duibatest') || href?.includes('localhost')
const testNode = cc.find('test', this.node)
testNode.active = isTest
if (isTest) {
const testEventMap = {
next: 'nextLevel',
refreshProp: 'refreshStageProps',
addTime: 'addTime'
}
testNode.children.forEach((n) => {
const event = this?.[testEventMap[n.name]]
n.on(cc.Node.EventType.TOUCH_END, event, this)
})
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment