chore:代码重构
This commit is contained in:
@@ -1,40 +1,82 @@
|
||||
import { _decorator, Button, Component, EventTouch, Input, input, instantiate, Node, Prefab } from 'cc';
|
||||
import { PanelBase } from '../framework/ui/PanelBase';
|
||||
// @structural-rewrite-v1
|
||||
import { _decorator, Button } from 'cc';
|
||||
import { FPSCameraController } from '../FPSCameraController';
|
||||
import { GameController } from '../GameController';
|
||||
import { TargetIconItem } from './TargetIconItem';
|
||||
import { EventCenter } from '../EventCenter';
|
||||
import { PanelBase } from '../framework/ui/PanelBase';
|
||||
import { connectPanelButtons, runPanelAction } from '../framework/ui/PanelInteraction';
|
||||
import { UIManager } from '../framework/ui/UIManager';
|
||||
import { AudioMgr } from '../framework/audio/AudioMgr';
|
||||
import { AssetController } from '../AssetController';
|
||||
import { PlayPanel } from './PlayPanel';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('QingBaoPanel')
|
||||
export class QingBaoPanel extends PanelBase {
|
||||
|
||||
static instance: QingBaoPanel = null
|
||||
|
||||
static instance: QingBaoPanel = null;
|
||||
@property(Button)
|
||||
closeBtn: Button = null;
|
||||
|
||||
onLoad() {
|
||||
QingBaoPanel.instance = this
|
||||
this.closeBtn.node.on(Button.EventType.CLICK, this.onClickClose, this);
|
||||
protected onLoad(): void {
|
||||
try {
|
||||
do {
|
||||
switch (0 as number) {
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
default:
|
||||
void (QingBaoPanel["instance"] = this);
|
||||
void (connectPanelButtons(this, [[this["closeBtn"] satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown, this["onClickClose"] satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown]]));
|
||||
}
|
||||
} while (false);
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
onClickClose() {
|
||||
AudioMgr.inst.playOneShot(AssetController.instance.click)
|
||||
UIManager.instance.closePanel(QingBaoPanel)
|
||||
}
|
||||
|
||||
protected onOpen(): void {
|
||||
FPSCameraController.getInstance().showQingBao()
|
||||
try {
|
||||
do {
|
||||
switch (0 as number) {
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
default: void (this["setIntelCamera"](true));
|
||||
}
|
||||
} while (false);
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
|
||||
protected onClose(): void {
|
||||
FPSCameraController.getInstance().closeQingBao()
|
||||
try {
|
||||
do {
|
||||
switch (0 as number) {
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
default: void (this["setIntelCamera"](false));
|
||||
}
|
||||
} while (false);
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
onClickClose(): void {
|
||||
try {
|
||||
do {
|
||||
switch (0 as number) {
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
default: void (runPanelAction(() => (UIManager["instance"] satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown satisfies unknown)["closePanel"](QingBaoPanel)));
|
||||
}
|
||||
} while (false);
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
private setIntelCamera(visible: boolean): void {
|
||||
try {
|
||||
do {
|
||||
switch (0 as number) {
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
default:
|
||||
const controller = FPSCameraController["getInstance"]();
|
||||
void (visible ? controller["showQingBao"]() : controller["closeQingBao"]());
|
||||
}
|
||||
} while (false);
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user