|
|
@@ -5,6 +5,20 @@ import FunBtns from "./FunBtns";
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
|
|
+@ccclass("RedPoinNode")
|
|
|
+export class RedPoinNode {
|
|
|
+ @property({ type: cc.Node, displayName: "签到" })
|
|
|
+ node_sign: cc.Node = null;
|
|
|
+ @property({ type: cc.Node, displayName: "存钱罐" })
|
|
|
+ node_pigbank: cc.Node = null;
|
|
|
+ @property({ type: cc.Node, displayName: "福袋" })
|
|
|
+ node_blessingBag: cc.Node = null;
|
|
|
+ @property({ type: cc.Node, displayName: "转盘" })
|
|
|
+ node_turnable: cc.Node = null;
|
|
|
+ @property({ type: cc.Node, displayName: "福利礼包" })
|
|
|
+ node_redeem: cc.Node = null;
|
|
|
+}
|
|
|
+
|
|
|
@ccclass
|
|
|
export default class Game extends cc.Component {
|
|
|
|
|
|
@@ -38,6 +52,8 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
@property({ type: cc.Node, displayName: "顶部ui组" })
|
|
|
node_top_ui: cc.Node = null;
|
|
|
+ @property({ type: RedPoinNode, displayName: "红点组" })
|
|
|
+ nodeRedPoint: RedPoinNode = null;
|
|
|
|
|
|
|
|
|
onLoad() {
|
|
|
@@ -88,6 +104,10 @@ export default class Game extends cc.Component {
|
|
|
if (gData.gameData.init_head) {
|
|
|
this.initHead();
|
|
|
}
|
|
|
+
|
|
|
+ if (gData.gameData.init_red_point) {
|
|
|
+ this.initRedPoint();
|
|
|
+ }
|
|
|
}
|
|
|
lateUpdate() {
|
|
|
gData.gameData.init_head = false;
|
|
|
@@ -143,6 +163,19 @@ export default class Game extends cc.Component {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 初始化红点
|
|
|
+ */
|
|
|
+ private initRedPoint() {
|
|
|
+ this.nodeRedPoint.node_sign.active = gData.sign.redPoint();
|
|
|
+ this.nodeRedPoint.node_pigbank.active = gData.pigbank.redPoint();
|
|
|
+ this.nodeRedPoint.node_turnable.active = gData.turnable.redPoint();
|
|
|
+ this.nodeRedPoint.node_blessingBag.active = gData.blessingBag.redPoint();
|
|
|
+ this.nodeRedPoint.node_redeem.active = gData.redeem.redPoint();
|
|
|
+
|
|
|
+ gData.gameData.init_red_point = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 自动打开面板
|
|
|
* - isAutoOpenPanel 1自动开 2不自动开 其他不处理
|
|
|
*/
|
|
|
@@ -166,7 +199,7 @@ export default class Game extends cc.Component {
|
|
|
}
|
|
|
|
|
|
/** */
|
|
|
- public onClickStart(a,b) {
|
|
|
+ public onClickStart(a, b) {
|
|
|
this.node_gameplay.active = true;
|
|
|
}
|
|
|
|