Commit 9b08971c authored by haiyoucuv's avatar haiyoucuv

init

parent 86b876ef
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "92ff9886-7fb4-4641-b799-28871156bd6d",
"files": [],
"subMetas": {},
"userData": {
"isBundle": true
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "aef0fdf5-4746-48cd-95ba-fc71bb48526f",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level1"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "7d2e5c17-ae25-4463-b83b-2e6062ca13c3",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level10"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "53e57144-7c1d-4027-a81b-5473b76da97a",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level2"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "acd60852-2465-43a6-a1a1-aed6d55c508e",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level3"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f4f0f3e0-802c-4e93-aa10-f9040d8d4b13",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level4"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "84cd42a2-5ed9-4a12-a2d9-580a9b257fff",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level5"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e5c06d2b-5800-42e0-8ce9-2c47dce243dc",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level6"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e2f11ad5-5b1c-4fc7-b471-75cf0c5aa402",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level7"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "57f31237-9a2d-459a-b385-bbe40e4dbe46",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level8"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "362b5800-4e6b-407c-b5d1-5d709a58c1e4",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level9"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "23d02ce1-9d19-4cae-be78-ee7624e22e26",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "GamePage"
}
}
This diff is collapsed.
import { _decorator, find, instantiate, Label, ProgressBar } from 'cc'; import { _decorator, find, instantiate, Label, ProgressBar } from 'cc';
import { CarColorsGlobalInstance } from './CarColorsGlobalInstance'; import { CarColorsGlobalInstance } from './CarColorsGlobalInstance';
import { BundleCarColorsSysterm } from './Systerms/BundleCarColorsSysterm'; import { BundleCarColorsSysterm } from './Systerms/BundleCarColorsSysterm';
import { UICarColorsSysterm } from './Systerms/UICarColorsSysterm';
import { UINames } from './CarColorsGlobalTypes';
import { RoleCarColorsSysterm } from './Systerms/RoleCarColorsSysterm'; import { RoleCarColorsSysterm } from './Systerms/RoleCarColorsSysterm';
import { GlobalData, ConfigKeys } from '../../ScriptFrame/GlobalData'; import { GlobalData, ConfigKeys } from '../../ScriptFrame/GlobalData';
import { CarCarColorsSysterm } from './Systerms/CarCarColorsSysterm'; import { CarCarColorsSysterm } from './Systerms/CarCarColorsSysterm';
import Scene from "db://assets/core/Module/Scene"; import Scene from "db://assets/core/Module/Scene";
import { showToast } from "db://assets/core/Module/UIFast"; import { changeScene, showToast } from "db://assets/core/Module/UIFast";
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr"; import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ccclass('CarColorsGameEntry') @ccclass('CarColorsGameEntry')
...@@ -32,19 +31,10 @@ export class CarColorsGameEntry extends Scene { ...@@ -32,19 +31,10 @@ export class CarColorsGameEntry extends Scene {
// 汽车管理系统 // 汽车管理系统
CarColorsGlobalInstance.instance.carSysterm = this.node.addComponent(CarCarColorsSysterm) CarColorsGlobalInstance.instance.carSysterm = this.node.addComponent(CarCarColorsSysterm)
// 挂载UI系统
CarColorsGlobalInstance.instance.uiSysterm = this.node.addComponent(UICarColorsSysterm)
await CarColorsGlobalInstance.instance.uiSysterm.loadUIPrefabs()
await this.startGame(); await this.startGame();
} }
async startGame(){ async startGame(){
find("Main Camera").active = true
find("UI/BundleLoading").active = true
find("UI/BundleLoading/ProgressBar").getComponent(ProgressBar).progress = 0.5
find("UI/BundleLoading/Text").getComponent(Label).string = "场景加载中"
find("Scene/Parkings").children.forEach((child, index)=>{ find("Scene/Parkings").children.forEach((child, index)=>{
if (index < 4){ if (index < 4){
child.name = "empty" child.name = "empty"
...@@ -59,7 +49,9 @@ export class CarColorsGameEntry extends Scene { ...@@ -59,7 +49,9 @@ export class CarColorsGameEntry extends Scene {
find("Scene/Parkings").active = true find("Scene/Parkings").active = true
CarColorsGlobalInstance.instance.roleSysterm.clearAll() CarColorsGlobalInstance.instance.roleSysterm.clearAll()
CarColorsGlobalInstance.instance.carSysterm.clearAll() CarColorsGlobalInstance.instance.carSysterm.clearAll()
CarColorsGlobalInstance.instance.bundleSysterm.loadLevels(GlobalData.instance.getConfigData(ConfigKeys.GameSaveData).level).then((level)=>{ CarColorsGlobalInstance.instance.bundleSysterm.loadLevels(
GlobalData.instance.getConfigData(ConfigKeys.GameSaveData).level
).then((level) => {
console.log("instantiate(level)") console.log("instantiate(level)")
const Level = instantiate(level) const Level = instantiate(level)
find("Scene/Levels").addChild(Level) find("Scene/Levels").addChild(Level)
...@@ -67,12 +59,10 @@ export class CarColorsGameEntry extends Scene { ...@@ -67,12 +59,10 @@ export class CarColorsGameEntry extends Scene {
CarColorsGlobalInstance.instance.carSysterm.addCar(Level.children[i]) CarColorsGlobalInstance.instance.carSysterm.addCar(Level.children[i])
} }
CarColorsGlobalInstance.instance.roleSysterm.initLevel() CarColorsGlobalInstance.instance.roleSysterm.initLevel()
CarColorsGlobalInstance.instance.uiSysterm.showUI(UINames.GamePage)
find("UI/BundleLoading").active = false
}).catch((err)=>{ }).catch((err)=>{
console.log(err) console.log(err)
showToast("关卡正在制作中") showToast("关卡正在制作中")
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.GamePage) changeScene(HomeScene);
}) })
AudioMgr.ins.playOneShot(AudioClipName.start); AudioMgr.ins.playOneShot(AudioClipName.start);
......
import { _decorator, Component, Node } from 'cc'; import { _decorator, Component, Node } from 'cc';
import { BundleCarColorsSysterm } from './Systerms/BundleCarColorsSysterm'; import { BundleCarColorsSysterm } from './Systerms/BundleCarColorsSysterm';
import { UICarColorsSysterm } from './Systerms/UICarColorsSysterm';
import { RoleCarColorsSysterm } from './Systerms/RoleCarColorsSysterm'; import { RoleCarColorsSysterm } from './Systerms/RoleCarColorsSysterm';
import { CarCarColorsSysterm } from './Systerms/CarCarColorsSysterm'; import { CarCarColorsSysterm } from './Systerms/CarCarColorsSysterm';
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -18,7 +17,6 @@ export class CarColorsGlobalInstance extends Component { ...@@ -18,7 +17,6 @@ export class CarColorsGlobalInstance extends Component {
} }
public bundleSysterm: BundleCarColorsSysterm = null public bundleSysterm: BundleCarColorsSysterm = null
public uiSysterm: UICarColorsSysterm = null
public roleSysterm: RoleCarColorsSysterm = null public roleSysterm: RoleCarColorsSysterm = null
public carSysterm: CarCarColorsSysterm = null public carSysterm: CarCarColorsSysterm = null
......
...@@ -3,13 +3,9 @@ export const BundleNames = { ...@@ -3,13 +3,9 @@ export const BundleNames = {
UI: "UI", UI: "UI",
// CarColorsCars: "CarColorsCars", // CarColorsCars: "CarColorsCars",
CarColorsCharacter:"CarColorsCharacter", CarColorsCharacter:"CarColorsCharacter",
CarColorsLevels: "CarColorsLevels",
Audio:"Audio", Audio:"Audio",
} }
// Ui列表
export enum UINames {
GamePage,
}
export enum CarTypes { export enum CarTypes {
Sedan, Sedan,
Bus, Bus,
......
import { _decorator, color, Color, Component, Enum, find, Material, MeshRenderer, Node, tween, Vec3 } from 'cc'; import { _decorator, color, Color, Component, Enum, find, Material, MeshRenderer, Node, tween, Vec3 } from 'cc';
import { CarColors, CarTypes, UINames } from '../CarColorsGlobalTypes'; import { CarColors, CarTypes } from '../CarColorsGlobalTypes';
import { RoleCarColorsComponent } from './RoleCarColorsComponent'; import { RoleCarColorsComponent } from './RoleCarColorsComponent';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance'; import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { EDITOR_NOT_IN_PREVIEW } from 'cc/env'; import { EDITOR_NOT_IN_PREVIEW } from 'cc/env';
......
import { _decorator, AnimationClip, Component, Node, Animation } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UIBase')
export class UIBase extends Component {
@property(Animation)
animation: Animation = null
@property(AnimationClip)
showClip: AnimationClip = null
@property(AnimationClip)
hideClip: AnimationClip = null
status: string = "hide" // hide, show
show(opts?:any){
this.status = "show"
this.node.active = true
if (this.animation !== null){
this.animation.stop()
this.animation.play(this.showClip.name)
}
}
hide(){
this.status = "hide"
if (this.animation !== null){
this.animation.stop()
this.animation.once(Animation.EventType.FINISHED, ()=>{
this.node.active = false
this.node.removeFromParent()
})
this.animation.play(this.showClip.name)
}else {
this.node.active = false
this.node.removeFromParent()
}
}
refreshUI(){}
}
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "0125e0e5-a414-43e0-b0d4-c91523804b89",
"files": [],
"subMetas": {},
"userData": {}
}
...@@ -10,8 +10,7 @@ import { ...@@ -10,8 +10,7 @@ import {
Prefab, Prefab,
ProgressBar ProgressBar
} from 'cc'; } from 'cc';
import { BundleNames, RoleNames, UINames } from '../CarColorsGlobalTypes'; import { BundleNames, RoleNames } from '../CarColorsGlobalTypes';
import { AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -51,31 +50,6 @@ export class BundleCarColorsSysterm extends Component { ...@@ -51,31 +50,6 @@ export class BundleCarColorsSysterm extends Component {
await Promise.all(promiseList) await Promise.all(promiseList)
} }
// UI资源————————————————————————————————————————————————————————————————————————————————
loadUIPrefab(): Array<Promise<Prefab>> {
const promiseList: Array<Promise<Prefab>> = []
const uiNames = Object.keys(UINames).filter(item => isNaN(Number(item)))
let total = uiNames.length
let progress = 0
uiNames.forEach((key) => {
const promise: Promise<Prefab> = new Promise((res, rej) => {
this.bundles.get(BundleNames.UI).load(key, Prefab, (err, prefab: Prefab) => {
if (err) {
console.error(err)
rej(err)
return
}
find("UI/BundleLoading/ProgressBar").getComponent(ProgressBar).progress = progress / total
find("UI/BundleLoading/Text").getComponent(Label).string = `初始化UI ${progress}/${total}`
res(prefab)
})
})
promiseList.push(promise)
})
return promiseList
}
// 角色资源———————————————————————————————————————————————————————————————————————————————— // 角色资源————————————————————————————————————————————————————————————————————————————————
loadRolePrefab(): Array<Promise<Prefab>> { loadRolePrefab(): Array<Promise<Prefab>> {
const promiseList: Array<Promise<Prefab>> = [] const promiseList: Array<Promise<Prefab>> = []
...@@ -101,42 +75,13 @@ export class BundleCarColorsSysterm extends Component { ...@@ -101,42 +75,13 @@ export class BundleCarColorsSysterm extends Component {
return promiseList return promiseList
} }
// 音乐资源————————————————————————————————————————————————————————————————————————————————
loadAudioClips(): Array<Promise<{ key: string, clip: AudioClip }>> {
const promiseList: Array<Promise<{ key: string, clip: AudioClip }>> = []
const clipNames = Object.keys(AudioClipNames).filter(item => isNaN(Number(item)))
let total = clipNames.length
let progress = 0
find("UI/BundleLoading/ProgressBar").getComponent(ProgressBar).progress = progress / total
find("UI/BundleLoading/Text").getComponent(Label).string = `初始化音频 ${progress}/${total}`
clipNames.forEach((key) => {
const promise: Promise<{ key: string, clip: AudioClip }> = new Promise((res, rej) => {
this.bundles.get(BundleNames.Audio).load(key, AudioClip, (err, clip: AudioClip) => {
if (err) {
console.error(err)
rej(err)
return
}
progress += 1
find("UI/BundleLoading/ProgressBar").getComponent(ProgressBar).progress = progress / total
find("UI/BundleLoading/Text").getComponent(Label).string = `初始化音频 ${progress}/${total}`
res({ key, clip })
})
})
promiseList.push(promise)
})
return promiseList
}
// 加载关卡 // 加载关卡
loadLevels(lv: number): Promise<Prefab> { loadLevels(lv: number): Promise<Prefab> {
if (lv > 10) { if (lv > 10) {
lv = lv % 5 + 5 lv = lv % 5 + 5
} }
const promise: Promise<Prefab> = new Promise((res, rej) => { const promise: Promise<Prefab> = new Promise((res, rej) => {
this.bundles.get(BundleNames.CarColorsLevels).load(`level${lv}`, Prefab, (err, prefab: Prefab) => { assetManager.getBundle("MainGame").load(`Levels/level${lv}`, Prefab, (err, prefab: Prefab) => {
if (err) { if (err) {
// console.error(err) // console.error(err)
rej(err) rej(err)
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
Vec3 Vec3
} from 'cc'; } from 'cc';
import { RoleCarColorsComponent } from '../Components/RoleCarColorsComponent'; import { RoleCarColorsComponent } from '../Components/RoleCarColorsComponent';
import { CarColors, CarTypes, UINames } from '../CarColorsGlobalTypes'; import { CarColors, CarTypes } from '../CarColorsGlobalTypes';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance'; import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { CarCarColorsComponent } from '../Components/CarCarColorsComponent'; import { CarCarColorsComponent } from '../Components/CarCarColorsComponent';
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr"; import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
......
import { _decorator, Component, find, instantiate, Node, Prefab } from 'cc';
import { UINames } from '../CarColorsGlobalTypes';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UIBase } from '../Components/UIBase';
const { ccclass, property } = _decorator;
@ccclass('UICarColorsSysterm')
export class UICarColorsSysterm extends Component {
UIScrpits: Map<string, UIBase> = new Map()
// 提前实例化UI预制体
async loadUIPrefabs() {
const uiNames = Object.keys(UINames).filter(item => isNaN(Number(item)))
const prefabList: Array<Prefab> = await Promise.all(CarColorsGlobalInstance.instance.bundleSysterm.loadUIPrefab())
prefabList.forEach((prefab, index) => {
const ui = instantiate(prefab)
const uiScript = ui.getComponent(UIBase)
this.UIScrpits.set(uiNames[index], uiScript)
})
}
showUI(name: UINames, opts?: any) {
this.UIScrpits.get(UINames[name]).node.parent = find("UI/Normal")
this.UIScrpits.get(UINames[name]).show(opts)
}
showTopUI(name: UINames, opts?: any) {
this.UIScrpits.get(UINames[name]).node.parent = find("UI/Top")
this.UIScrpits.get(UINames[name]).show(opts)
}
showUIWithParent(name: UINames, parent: Node, opts?: any) {
this.UIScrpits.get(UINames[name]).node.parent = parent
this.UIScrpits.get(UINames[name]).show(opts)
}
hideUI(name: UINames) {
this.UIScrpits.get(UINames[name])?.hide()
}
}
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "1b2d5817-6885-4550-8134-e609f5d09baa",
"files": [],
"subMetas": {},
"userData": {}
}
This diff is collapsed.
import { _decorator, AudioClip, AudioSource } from 'cc';
import { ConfigKeys, GlobalData } from '../GlobalData';
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
const { ccclass, property } = _decorator;
// 音效列表
export enum AudioClipNames{
bgm,
button_ok,
start,
upgrade,
crash,
brake,
win,
helico,A
}
@ccclass('AudioManager')
export class AudioManager {
private audioSource: AudioSource = null;
private soundOn: boolean = true
clips: Map<string, AudioClip> = new Map()
private static _instance: AudioManager;
public static get instance () {
if (this._instance) {
return this._instance;
}
this._instance = new AudioManager();
return this._instance;
}
init(audioSource: AudioSource, allClips:Array<{key:string,clip:AudioClip}>){
allClips.forEach(item=>{
this.clips.set(item.key, item.clip)
})
this.audioSource = audioSource
this.getSoundConfig()
if (this.soundOn){
AudioMgr.ins.play(AudioClipName.bgm, { loop: true });
}else {
this.pause()
}
}
getSoundConfig(){
this.soundOn = GlobalData.instance.getConfigData(ConfigKeys.soundsOn)
if (this.soundOn === null){
this.soundOn = true
}
return this.soundOn
}
setSoundConfig(soundOn: boolean) {
this.soundOn = soundOn
if (this.soundOn){
this.play()
}else {
this.pause()
}
GlobalData.instance.setConfigData(ConfigKeys.soundsOn, this.soundOn)
}
play () {
if (!this.soundOn) return
// 播放音乐
this.audioSource.play();
}
pause () {
// 暂停音乐
this.audioSource.pause();
}
playBgm (clipName: AudioClipNames) {
if (!this.soundOn) return
this.audioSource.stop()
this.audioSource.clip = this.clips.get(AudioClipNames[clipName])
this.audioSource.play();
}
playOneShot (clipName: AudioClipNames, volume: number = 1) {
if (!this.soundOn) return
this.audioSource.playOneShot(this.clips.get(AudioClipNames[clipName]), volume);
}
}
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "1331740b-54c2-477d-8c59-52197e958409",
"files": [],
"subMetas": {},
"userData": {}
}
...@@ -2,7 +2,6 @@ import { _decorator, find, instantiate, Label, ProgressBar } from 'cc'; ...@@ -2,7 +2,6 @@ import { _decorator, find, instantiate, Label, ProgressBar } from 'cc';
import { changeScene, showToast } from "db://assets/core/Module/UIFast"; import { changeScene, showToast } from "db://assets/core/Module/UIFast";
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr"; import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
import { CarColorsGlobalInstance } from "db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance"; import { CarColorsGlobalInstance } from "db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance";
import { UINames } from "db://assets/CarColorsGame/Scrips/CarColorsGlobalTypes";
import { ConfigKeys, GlobalData } from "db://assets/ScriptFrame/GlobalData"; import { ConfigKeys, GlobalData } from "db://assets/ScriptFrame/GlobalData";
import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene"; import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene";
import Panel from "db://assets/core/Module/Panel"; import Panel from "db://assets/core/Module/Panel";
...@@ -28,9 +27,6 @@ export class FailPage extends Panel { ...@@ -28,9 +27,6 @@ export class FailPage extends Panel {
} }
async startGame() { async startGame() {
find("UI/BundleLoading").active = true
find("UI/BundleLoading/ProgressBar").getComponent(ProgressBar).progress = 0.5
find("UI/BundleLoading/Text").getComponent(Label).string = "场景加载中"
find("Scene/Parkings").children.forEach((child, index) => { find("Scene/Parkings").children.forEach((child, index) => {
if (index < 4) { if (index < 4) {
child.name = "empty" child.name = "empty"
...@@ -53,8 +49,6 @@ export class FailPage extends Panel { ...@@ -53,8 +49,6 @@ export class FailPage extends Panel {
CarColorsGlobalInstance.instance.carSysterm.addCar(Level.children[i]) CarColorsGlobalInstance.instance.carSysterm.addCar(Level.children[i])
} }
CarColorsGlobalInstance.instance.roleSysterm.initLevel() CarColorsGlobalInstance.instance.roleSysterm.initLevel()
CarColorsGlobalInstance.instance.uiSysterm.showUI(UINames.GamePage)
find("UI/BundleLoading").active = false
}).catch((err) => { }).catch((err) => {
// console.log(err) // console.log(err)
showToast("关卡正在制作中") showToast("关卡正在制作中")
......
...@@ -5,7 +5,6 @@ import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene"; ...@@ -5,7 +5,6 @@ import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene";
import Panel from "db://assets/core/Module/Panel"; import Panel from "db://assets/core/Module/Panel";
import { CarColorsGlobalInstance } from "db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance"; import { CarColorsGlobalInstance } from "db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance";
import { ConfigKeys, GlobalData } from "db://assets/ScriptFrame/GlobalData"; import { ConfigKeys, GlobalData } from "db://assets/ScriptFrame/GlobalData";
import { UINames } from "db://assets/CarColorsGame/Scrips/CarColorsGlobalTypes";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ccclass('StopPage') @ccclass('StopPage')
...@@ -33,9 +32,6 @@ export class StopPage extends Panel { ...@@ -33,9 +32,6 @@ export class StopPage extends Panel {
} }
async startGame(){ async startGame(){
find("UI/BundleLoading").active = true
find("UI/BundleLoading/ProgressBar").getComponent(ProgressBar).progress = 0.5
find("UI/BundleLoading/Text").getComponent(Label).string = "场景加载中"
find("Scene/Parkings").children.forEach((child, index)=>{ find("Scene/Parkings").children.forEach((child, index)=>{
if (index < 4){ if (index < 4){
child.name = "empty" child.name = "empty"
...@@ -58,8 +54,6 @@ export class StopPage extends Panel { ...@@ -58,8 +54,6 @@ export class StopPage extends Panel {
CarColorsGlobalInstance.instance.carSysterm.addCar(Level.children[i]) CarColorsGlobalInstance.instance.carSysterm.addCar(Level.children[i])
} }
CarColorsGlobalInstance.instance.roleSysterm.initLevel() CarColorsGlobalInstance.instance.roleSysterm.initLevel()
CarColorsGlobalInstance.instance.uiSysterm.showUI(UINames.GamePage)
find("UI/BundleLoading").active = false
}).catch((err)=>{ }).catch((err)=>{
// console.log(err) // console.log(err)
showToast("关卡正在制作中") showToast("关卡正在制作中")
......
This diff is collapsed.
This diff is collapsed.
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