2025-05-09 19:10:40 +08:00
|
|
|
import { config } from "./constants/config"
|
|
|
|
|
|
|
|
|
|
Laya.addBeforeInitCallback((stageConfig) => {
|
2025-05-12 10:43:02 +08:00
|
|
|
// const { breakpoint } = config
|
|
|
|
|
// if (window.innerWidth / window.innerHeight <= breakpoint) {
|
|
|
|
|
// stageConfig.designWidth = 1080
|
|
|
|
|
// stageConfig.designHeight = 1920
|
|
|
|
|
// stageConfig.scaleMode = "fixedwidth"
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// stageConfig.designWidth = 1920
|
|
|
|
|
// stageConfig.designHeight = 1080
|
|
|
|
|
// stageConfig.scaleMode = "fixedauto"
|
|
|
|
|
// }
|
2025-05-09 19:10:40 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export async function main() {
|
|
|
|
|
console.log("entry")
|
2025-05-14 19:22:21 +08:00
|
|
|
const { BREAK_POINT } = config
|
2025-05-09 19:10:40 +08:00
|
|
|
// 加载场景并打开场景
|
2025-05-14 19:22:21 +08:00
|
|
|
if (window.innerWidth / window.innerHeight <= BREAK_POINT) {
|
2025-05-09 19:10:40 +08:00
|
|
|
Laya.Scene.open("Scene.ls")
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
Laya.Scene.open("Scene.ls")
|
|
|
|
|
}
|
|
|
|
|
}
|