Commit 5593e933 authored by haiyoucuv's avatar haiyoucuv

init

parent 2cc7a7af
This diff is collapsed.
import { _decorator, Button, Label, Node, Sprite, SpriteFrame } from 'cc'; import { _decorator, Button, Label, Node } from 'cc';
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr"; import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
import Panel from "db://assets/core/Module/Panel"; import Panel from "db://assets/core/Module/Panel";
import { changeScene } from "db://assets/core/Module/UIFast"; import { changeScene } from "db://assets/core/Module/UIFast";
...@@ -7,6 +7,7 @@ import store from "db://assets/Scripts/store/store"; ...@@ -7,6 +7,7 @@ import store from "db://assets/Scripts/store/store";
import gameStore from "db://assets/Scripts/store/gameStore"; import gameStore from "db://assets/Scripts/store/gameStore";
import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame"; import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame";
import { _asyncThrottle } from "db://assets/Scripts/Utils/Utils"; import { _asyncThrottle } from "db://assets/Scripts/Utils/Utils";
import { LOG_TYPE, sendLog } from "db://assets/Scripts/Utils/WebNet/WebNet";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -24,6 +25,7 @@ export class OverPanel extends Panel { ...@@ -24,6 +25,7 @@ export class OverPanel extends Panel {
super.onLoad(); super.onLoad();
this.okBtn.on(Button.EventType.CLICK, this.ok, this); this.okBtn.on(Button.EventType.CLICK, this.ok, this);
this.closeBtn.on(Button.EventType.CLICK, this.cancel, this); this.closeBtn.on(Button.EventType.CLICK, this.cancel, this);
sendLog(LOG_TYPE.EXPOSURE, 17);
} }
start(): void { start(): void {
...@@ -42,6 +44,7 @@ export class OverPanel extends Panel { ...@@ -42,6 +44,7 @@ export class OverPanel extends Panel {
} }
ok = _asyncThrottle(async () => { ok = _asyncThrottle(async () => {
sendLog(LOG_TYPE.CLICK, 17);
AudioMgr.ins.playOneShot(AudioClipName.button_ok); AudioMgr.ins.playOneShot(AudioClipName.button_ok);
// changeScene(HomeScene); // changeScene(HomeScene);
......
import { _decorator, Button, Label, Node, Sprite, SpriteFrame } from 'cc'; import { _decorator, Button, Label, Node, Sprite, SpriteFrame } from 'cc';
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr"; import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
import Panel from "db://assets/core/Module/Panel"; import Panel from "db://assets/core/Module/Panel";
import { showPanel, showShareGuide } from "db://assets/core/Module/UIFast"; import { showShareGuide } from "db://assets/core/Module/UIFast";
import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame"; import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame";
import gameStore from "db://assets/Scripts/store/gameStore"; import gameStore from "db://assets/Scripts/store/gameStore";
import { _asyncThrottle } from "db://assets/Scripts/Utils/Utils"; import { _asyncThrottle } from "db://assets/Scripts/Utils/Utils";
import { CarColorsGlobalInstance } from "db://assets/Scripts/Scenes/MainGame/CarColorsGlobalInstance"; import { CarColorsGlobalInstance } from "db://assets/Scripts/Scenes/MainGame/CarColorsGlobalInstance";
import store from "db://assets/Scripts/store/store"; import store from "db://assets/Scripts/store/store";
import { LOG_TYPE, sendLog } from "db://assets/Scripts/Utils/WebNet/WebNet";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -35,11 +36,13 @@ export class ReviewPanel extends Panel { ...@@ -35,11 +36,13 @@ export class ReviewPanel extends Panel {
if (lockIndex == 4) { if (lockIndex == 4) {
if (gameStore.startInfo.shareUnlocked) { if (gameStore.startInfo.shareUnlocked) {
this.type = "green"; this.type = "green";
sendLog(LOG_TYPE.EXPOSURE, 16);
} else { } else {
this.type = "share"; this.type = "share";
} }
} else { } else {
this.type = "credits"; this.type = "credits";
sendLog(LOG_TYPE.EXPOSURE, 15);
} }
console.log("解锁类型", this.type); console.log("解锁类型", this.type);
...@@ -70,6 +73,12 @@ export class ReviewPanel extends Panel { ...@@ -70,6 +73,12 @@ export class ReviewPanel extends Panel {
ok = _asyncThrottle(async () => { ok = _asyncThrottle(async () => {
const { type } = this; const { type } = this;
if(type == "credits"){
sendLog(LOG_TYPE.CLICK, 15);
}else if(type == "green"){
sendLog(LOG_TYPE.CLICK, 16);
}
AudioMgr.ins.playOneShot(AudioClipName.button_ok); AudioMgr.ins.playOneShot(AudioClipName.button_ok);
const lockIndex = MainGame.ins.getLockPoints(); const lockIndex = MainGame.ins.getLockPoints();
if (type == "share") { if (type == "share") {
......
...@@ -7,6 +7,7 @@ import Scene from "db://assets/core/Module/Scene"; ...@@ -7,6 +7,7 @@ import Scene from "db://assets/core/Module/Scene";
import { changeScene } from "db://assets/core/Module/UIFast"; import { changeScene } from "db://assets/core/Module/UIFast";
import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame"; import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame";
import Svga from "db://assets/core/Component/Svga/Svga"; import Svga from "db://assets/core/Component/Svga/Svga";
import { LOG_TYPE, sendLog } from "db://assets/Scripts/Utils/WebNet/WebNet";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -29,7 +30,10 @@ export class GuideScene extends Scene { ...@@ -29,7 +30,10 @@ export class GuideScene extends Scene {
onLoad() { onLoad() {
this.nextGuide(); this.nextGuide();
this.node.on(Node.EventType.TOUCH_END, this.nextGuide, this); this.node.on(Node.EventType.TOUCH_END, ()=>{
sendLog(LOG_TYPE.CLICK, 6 + this.guideIndex);
this.nextGuide();
}, this);
// this.svga.node.on(Svga.EventType.END_FRAME, this.onSvgaEnd, this); // this.svga.node.on(Svga.EventType.END_FRAME, this.onSvgaEnd, this);
...@@ -41,9 +45,10 @@ export class GuideScene extends Scene { ...@@ -41,9 +45,10 @@ export class GuideScene extends Scene {
nextGuide() { nextGuide() {
if (!this.canNext) return; if (!this.canNext) return;
this.canNext = false; this.canNext = false;
sendLog(LOG_TYPE.EXPOSURE, 6 + this.guideIndex);
this.svga.play(); this.svga.play();
tween(this.tipSp.getComponent(UIOpacity)) tween(this.tipSp.getComponent(UIOpacity))
.set({ opacity: 0 }) .set({ opacity: 0 })
......
...@@ -16,7 +16,7 @@ import store from "../store/store"; ...@@ -16,7 +16,7 @@ import store from "../store/store";
import { observer, render } from "../store/decorators"; import { observer, render } from "../store/decorators";
import { _asyncThrottle } from "../Utils/Utils"; import { _asyncThrottle } from "../Utils/Utils";
import { MainGame } from "./MainGame/MainGame"; import { MainGame } from "./MainGame/MainGame";
import { sendWebNet, WebNetName } from "db://assets/Scripts/Utils/WebNet/WebNet"; import { LOG_TYPE, sendLog, sendWebNet, WebNetName } from "db://assets/Scripts/Utils/WebNet/WebNet";
import { BoxPanel } from "db://assets/Scripts/Panels/BoxPanel"; import { BoxPanel } from "db://assets/Scripts/Panels/BoxPanel";
import gameStore from "db://assets/Scripts/store/gameStore"; import gameStore from "db://assets/Scripts/store/gameStore";
import { GuideScene } from "db://assets/Scripts/Scenes/GuideScene"; import { GuideScene } from "db://assets/Scripts/Scenes/GuideScene";
...@@ -55,6 +55,11 @@ export class HomeScene extends Scene { ...@@ -55,6 +55,11 @@ export class HomeScene extends Scene {
this.startBtn.on(Button.EventType.CLICK, this.clickStart, this); this.startBtn.on(Button.EventType.CLICK, this.clickStart, this);
this.ruleBtn.on(Button.EventType.CLICK, this.clickRule, this); this.ruleBtn.on(Button.EventType.CLICK, this.clickRule, this);
this.prizeBtn.on(Button.EventType.CLICK, this.clickPrize, this); this.prizeBtn.on(Button.EventType.CLICK, this.clickPrize, this);
sendLog(LOG_TYPE.EXPOSURE, 2);
sendLog(LOG_TYPE.EXPOSURE, 3);
sendLog(LOG_TYPE.EXPOSURE, 4);
sendLog(LOG_TYPE.EXPOSURE, 5);
} }
async start() { async start() {
...@@ -109,7 +114,10 @@ export class HomeScene extends Scene { ...@@ -109,7 +114,10 @@ export class HomeScene extends Scene {
this.boxRoot.addChild(item); this.boxRoot.addChild(item);
item.setPosition(-500 / 2 + i / Math.max(1, len - 1) * 500, 0); item.setPosition(-500 / 2 + i / Math.max(1, len - 1) * 500, 0);
item.on(Button.EventType.CLICK, this.openBox.bind(this, boxConfigs[i]), this); item.on(Button.EventType.CLICK, () => {
sendLog(LOG_TYPE.CLICK, 2 + i);
this.openBox.bind(this, boxConfigs[i])();
}, this);
} }
this.progress.progress = maxIndex / Math.max(1, len - 1); this.progress.progress = maxIndex / Math.max(1, len - 1);
...@@ -127,6 +135,7 @@ export class HomeScene extends Scene { ...@@ -127,6 +135,7 @@ export class HomeScene extends Scene {
}, 500) }, 500)
clickStart = _asyncThrottle(async () => { clickStart = _asyncThrottle(async () => {
sendLog(LOG_TYPE.CLICK, 5);
if (!store.checkActTime()) return; if (!store.checkActTime()) return;
......
...@@ -26,6 +26,7 @@ import { UnlockPanel } from "db://assets/Scripts/Panels/UnlockPanel"; ...@@ -26,6 +26,7 @@ import { UnlockPanel } from "db://assets/Scripts/Panels/UnlockPanel";
import { CarColorsGlobalInstance } from "db://assets/Scripts/Scenes/MainGame/CarColorsGlobalInstance"; import { CarColorsGlobalInstance } from "db://assets/Scripts/Scenes/MainGame/CarColorsGlobalInstance";
import gameStore from "db://assets/Scripts/store/gameStore"; import gameStore from "db://assets/Scripts/store/gameStore";
import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame"; import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame";
import { LOG_TYPE, sendLog } from "db://assets/Scripts/Utils/WebNet/WebNet";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -48,6 +49,11 @@ export class GamePage extends Component { ...@@ -48,6 +49,11 @@ export class GamePage extends Component {
this.smokePool.put(instantiate(smokeTemp)); this.smokePool.put(instantiate(smokeTemp));
this.smokePool.put(instantiate(smokeTemp)); this.smokePool.put(instantiate(smokeTemp));
} }
sendLog(LOG_TYPE.EXPOSURE, 12);
sendLog(LOG_TYPE.EXPOSURE, 13);
sendLog(LOG_TYPE.EXPOSURE, 14);
} }
getSmoke(): Node { getSmoke(): Node {
...@@ -89,10 +95,13 @@ export class GamePage extends Component { ...@@ -89,10 +95,13 @@ export class GamePage extends Component {
const parkIndex = parkPoint.getSiblingIndex(); const parkIndex = parkPoint.getSiblingIndex();
if (parkIndex === 4) { if (parkIndex === 4) {
sendLog(LOG_TYPE.CLICK, 12);
MainGame.ins.shareUnlock(); MainGame.ins.shareUnlock();
} else if (parkIndex === 5) { } else if (parkIndex === 5) {
sendLog(LOG_TYPE.CLICK, 13);
MainGame.ins.videoUnlock1(); MainGame.ins.videoUnlock1();
} else if (parkIndex === 6) { } else if (parkIndex === 6) {
sendLog(LOG_TYPE.CLICK, 14);
MainGame.ins.videoUnlock2(); MainGame.ins.videoUnlock2();
} }
return; return;
......
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