| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class RedPointM extends cc.Component {
- static instance: RedPointM;
- @property(cc.Node)
- chatPoint: cc.Node = null;
- @property(cc.Node)
- touZiPoint: cc.Node = null;
- @property(cc.Node)
- turnTablePoint: cc.Node = null;
- @property(cc.Node)
- taskPoint: cc.Node = null;
- @property(cc.Node)
- shopPoint: cc.Node = null;
- @property(cc.Node)
- chatPage: cc.Node = null;
- @property(cc.Node)
- matePoint: cc.Node = null;
- @property(cc.Node)
- dailyNode: cc.Node = null;
- // LIFE-CYCLE CALLBACKS:
- onLoad() {
- RedPointM.instance = this;
- }
- start() {
- }
- // update (dt) {}
- ActiveRedPoint(redPointType: RedPointType, active: boolean) {
- switch (redPointType) {
- case RedPointType.ChatReaPacket:
- // if (active) {
- // this.chatAniNode.active = true
- // this.chatPage.active = false
- // }
- // else {
- // this.chatAniNode.active = false
- // this.chatPage.active = true
- // }
- break;
- case RedPointType.Invest:
- this.touZiPoint.active = active;
- // this.touZiPoint.color = GameM.commonData.roleData.lv >= 5 ? cc.color(255, 255, 255, 255) : cc.color(126, 126, 126, 255);
- break;
- case RedPointType.Turnplate:
- this.turnTablePoint.active = active;
- // this.turnTablePoint.color = GameM.commonData.roleData.lv >= 4 ? cc.color(255, 255, 255, 255) : cc.color(126, 126, 126, 255);
- break;
- case RedPointType.Task:
- if (this.taskPoint.active == active) {
- return
- }
- this.taskPoint.active = active;
- if (active) {
- // this.taskPoint.getChildByName('rectpoint copy').getChildByName('common_img_geted').getComponent(cc.Label).string = '可领取'
- // if (GameM.commonData.roleData.lv >= 4) this.taskPoint.getComponent(cc.Animation).play("rectpointAni");
- // else this.taskPoint.getComponent(cc.Animation).play("rectpointAni - 001");
- this.taskPoint.getComponent(cc.Animation).play("rectpointAni");
- }
- break;
- case RedPointType.Shop:
- // this.shopPoint.active = active;
- // if (active) {
- // this.shopPoint.getComponent(cc.Animation).play("rectpointAni");
- // }
- break;
- case RedPointType.Mate:
- if (this.matePoint.active == active) {
- return
- }
- this.matePoint.active = active
- break;
- case RedPointType.Daily:
- if (this.dailyNode.active == active) {
- return
- }
- this.dailyNode.active = active
- break;
- }
- }
- UpdateRedPointState() {
- // this.touZiPoint.color = GameM.commonData.roleData.lv >= 5 ? cc.color(255, 255, 255, 255) : cc.color(126, 126, 126, 255);
- // this.turnTablePoint.color = GameM.commonData.roleData.lv >= 4 ? cc.color(255, 255, 255, 255) : cc.color(126, 126, 126, 255);
- // this.speedUpPoint.color = GameM.commonData.roleData.lv >= 7 ? cc.color(255, 255, 255, 255) : cc.color(126, 126, 126, 255);
- // if (this.taskPoint.active) {
- // if (GameM.commonData.roleData.lv >= 4) this.taskPoint.getComponent(cc.Animation).play("rectpointAni");
- // else this.taskPoint.getComponent(cc.Animation).play("rectpointAni - 001");
- // }
- // if (this.shopPoint.active) {
- // if (GameM.commonData.roleData.lv >= 3) this.shopPoint.getComponent(cc.Animation).play("rectpointAni");
- // else this.shopPoint.getComponent(cc.Animation).play("rectpointAni - 001");
- // }
- }
- }
- export enum RedPointType {
- /**聊天代码 */
- ChatReaPacket,
- /**投资 */
- Invest,
- /**转盘 */
- Turnplate,
- /**任务 */
- Task,
- /**商店 */
- Shop,
- /**日常任务 */
- DailyTask,
- /**任务成就 */
- TaskAchievement,
- /**银行 */
- Bank,
- /**伙伴 */
- Mate,
- /**每日登录 */
- Daily,
- }
|