| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import { GameData } from "../../../game/data/GameData";
- /** 气泡界面 */
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class QipaoPanel extends cc.Component {
- @property({ type: cc.Animation, displayName: '气泡动画' })
- airshipAni: cc.Animation = null;
- showRedNum = 0;
- countDown = 0;
- start() {
- this.airshipAni.node.active = false;
- }
- protected update(dt: number): void {
- if (gData.gameData.configs.ServerConfig) {
- if (gData.gameData.adShowConfig.average_ecpm < gData.gameData.configs.ServerConfig.FlyswitchECPM) {
- this.airshipAni.node.active = false
- return;
- }
- }
- if (this.showRedNum < 1) {
- this.countDown += dt;
- if (this.countDown >= 30) {
- this.countDown = 0;
- this.showRedNum++;
- this.airshipAni.node.active = true
- this.airshipAni.setCurrentTime(0, 'airship')
- this.airshipAni.play()
- }
- }
- }
- }
|