Commit 1a5a4dfb authored by haiyoucuv's avatar haiyoucuv

init

parent be225142
......@@ -33,8 +33,8 @@ export function hideToast() {
UIMgr.ins.hideToast();
}
export function showShareGuide() {
UIMgr.ins.showShareGuide();
export function showShareGuide(guideTxt = "") {
UIMgr.ins.showShareGuide(guideTxt);
}
export function hideShareGuide() {
......
......@@ -76,9 +76,9 @@ export class UIMgr {
this.toastBg = this.toast.getChildByName("bg");
this.toastLabel = this.toastBg.getChildByName("label");
this.showGuide = this.uiCanvas.getChildByName("ShareGuide");
this.shareGuide = this.uiCanvas.getChildByName("ShareGuide");
this.hideShareGuide();
this.showGuide.on(Button.EventType.CLICK, this.hideShareGuide, this);
this.shareGuide.on(Button.EventType.CLICK, this.hideShareGuide, this);
this.waiting.active = false;
this.toast.active = false;
......@@ -86,14 +86,16 @@ export class UIMgr {
/********* Share Guide *********/
showGuide: Node = null;
shareGuide: Node = null;
showShareGuide() {
this.showGuide.active = true;
showShareGuide(guideTxt = "") {
this.shareGuide.active = true;
this.shareGuide.getChildByName("label")
.getComponent(Label).string = guideTxt;
}
hideShareGuide() {
this.showGuide.active = false;
this.shareGuide.active = false;
}
/********* Share Guide *********/
......
......@@ -6,6 +6,7 @@ import gameStore from "../store/gameStore";
import { MainGame } from "../Scenes/MainGame/MainGame";
import { hideShareGuide, showShareGuide, showToast } from "../../Module/UIFast";
import { unwatchPageVisibility, watchPageVisibility } from "../Utils/pageVisibilityNotify";
import { UIMgr } from "../../Module/UIMgr";
const { ccclass, property } = _decorator;
......@@ -35,19 +36,19 @@ export default class GameRevivePanel extends Panel {
this.shareRevive.on(Button.EventType.CLICK, this.clickShare, this);
this.overBtn.on(Button.EventType.CLICK, this.clickOver, this);
watchPageVisibility(this.onPageVisibility);
// watchPageVisibility(this.onPageVisibility);
}
onDestroy() {
unwatchPageVisibility(this.onPageVisibility);
// unwatchPageVisibility(this.onPageVisibility);
}
onPageVisibility = (visible) => {
if (visible && this.isClickShare && !this.isReview) {
hideShareGuide();
this.review(3);
}
};
// onPageVisibility = (visible) => {
// if (visible && this.isClickShare && !this.isReview) {
// hideShareGuide();
// this.review(3);
// }
// };
async start() {
const {
......@@ -133,7 +134,13 @@ export default class GameRevivePanel extends Panel {
this.clickFlag = true;
this.isClickShare = true;
this.cd.stop();
showShareGuide();
showShareGuide("分享好友后,点击屏幕即可复活");
const clickGuide = () => {
UIMgr.ins.shareGuide.off(Button.EventType.CLICK, clickGuide, this);
hideShareGuide();
this.review(3);
};
UIMgr.ins.shareGuide.once(Button.EventType.CLICK, clickGuide, this);
}
......
......@@ -782,7 +782,7 @@
"__prefab": {
"__id__": 33
},
"_opacity": 178.5,
"_opacity": 204,
"_id": ""
},
{
......@@ -986,7 +986,7 @@
"__id__": 24
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 44
......
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