Commit 2ee5617e authored by Vũ Gia Vương's avatar Vũ Gia Vương

convert prefab to scene

parent 07960215
{
"ver": "1.3.2",
"uuid": "c035ce77-4ebb-4255-94ff-c5a64737b575",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.3.2",
"uuid": "f6c31663-b4ec-4a86-bf0f-48a96158db5f",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.1.3",
"uuid": "397b1948-b4fa-4521-bb60-fb709143df90",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "1.3.2", "ver": "1.3.2",
"uuid": "88c28e89-077d-4fdc-bb6c-dfa486e59e47", "uuid": "8ad3fe7a-81ff-45c8-8682-74b87a609e79",
"importer": "prefab", "importer": "scene",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"readonly": false, "autoReleaseAssets": false,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
This diff is collapsed.
{ {
"ver": "2.3.7", "ver": "2.3.7",
"uuid": "bcd81337-7998-47e5-b339-8843b30a723f", "uuid": "4ab88f0b-948d-4252-87ac-cc4597ae899b",
"importer": "texture", "importer": "texture",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 765, "width": 347,
"height": 664, "height": 309,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"photo_2025-05-09_11-00-26": { "jar (2)": {
"ver": "1.0.6", "ver": "1.0.6",
"uuid": "aa7cc229-2f72-4970-b3ef-b1599b596bc5", "uuid": "8e65fd28-69a0-4fc2-8f60-60825281f5cf",
"importer": "sprite-frame", "importer": "sprite-frame",
"rawTextureUuid": "bcd81337-7998-47e5-b339-8843b30a723f", "rawTextureUuid": "4ab88f0b-948d-4252-87ac-cc4597ae899b",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 765, "width": 347,
"height": 664, "height": 309,
"rawWidth": 765, "rawWidth": 347,
"rawHeight": 664, "rawHeight": 309,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
export class Global { export class Global {
public static tool: number = 0;
public static getRandomTimeSkew() { public static getRandomTimeSkew() {
return Math.random() * 0.05 + 0.03; return Math.random() * 0.05 + 0.03;
......
const { ccclass, property } = cc._decorator;
@ccclass
export default class Main extends cc.Component {
@property(cc.Prefab)
private startScreenPrefab: cc.Prefab = null;
@property(cc.Prefab)
private gamePlayScreenPrefab: cc.Prefab = null;
@property(cc.Prefab)
private cardPopupPrefab: cc.Prefab = null;
protected start(): void {
this.node.addChild(cc.instantiate(this.startScreenPrefab));
this.node.addChild(cc.instantiate(this.gamePlayScreenPrefab));
this.node.addChild(cc.instantiate(this.cardPopupPrefab));
}
}
{
"ver": "1.1.0",
"uuid": "6ea6bfd9-7d62-4e7b-b40d-7fc72135d194",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { eventTarget, RESET_BOTTLE, SHOW_ACTION_SCREEN, SHOW_START_SCREEN } from "../Events";
const { ccclass, property } = cc._decorator;
@ccclass
export default class BreakingBottleScreen extends cc.Component {
onLoad() {
eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this);
eventTarget.on(SHOW_START_SCREEN, this.hideScreen, this);
this.node.position = cc.v3(0, 0, 0);
this.node.opacity = 0;
}
private showScreen() {
this.node.opacity = 255;
this.node.position = cc.v3();
eventTarget.emit(RESET_BOTTLE);
}
private hideScreen() {
this.node.opacity = 0;
}
}
{
"ver": "1.1.0",
"uuid": "90267826-75d6-4f90-b056-fde22260947a",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -6,7 +6,6 @@ const { ccclass, property } = cc._decorator; ...@@ -6,7 +6,6 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class CardPopup extends cc.Component { export default class CardPopup extends cc.Component {
private _replayBtn: cc.Node; private _replayBtn: cc.Node;
...@@ -25,7 +24,6 @@ export default class CardPopup extends cc.Component { ...@@ -25,7 +24,6 @@ export default class CardPopup extends cc.Component {
private onReplayBtnClick() { private onReplayBtnClick() {
this.node.active = false; this.node.active = false;
eventTarget.emit(SHOW_START_SCREEN); cc.director.loadScene('home');
eventTarget.emit(STOP_ANIM_CHUM);
} }
} }
import { eventTarget, SHOW_ACTION_SCREEN, SHOW_START_SCREEN, START_GUILD_TAP } from "../Events";
import { Global } from "../Global";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -10,17 +8,10 @@ export default class StartScreen extends cc.Component { ...@@ -10,17 +8,10 @@ export default class StartScreen extends cc.Component {
protected onLoad(): void { protected onLoad(): void {
this.selectBtnNode.on('click', this.onSelectBtnClick, this); this.selectBtnNode.on('click', this.onSelectBtnClick, this);
// cc.director.preloadScene('main');
eventTarget.on(SHOW_START_SCREEN, () => this.node.active = true, this);
eventTarget.on(SHOW_ACTION_SCREEN, () => this.node.active = false, this);
this.scheduleOnce(this.onSelectBtnClick, 0.2);
} }
private onSelectBtnClick() { private onSelectBtnClick() {
Global.tool = 3; cc.director.loadScene('main');
eventTarget.emit(SHOW_ACTION_SCREEN);
eventTarget.emit(START_GUILD_TAP);
} }
} }
...@@ -62,5 +62,6 @@ ...@@ -62,5 +62,6 @@
"audience": { "audience": {
"enable": false "enable": false
} }
} },
"start-scene": "8ad3fe7a-81ff-45c8-8682-74b87a609e79"
} }
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