import { _decorator, Color, Component, Label, Node, Sprite, tween, Vec2, Vec3 } from 'cc'; import { Global } from './Global'; import { PropsAction } from './PropsAction'; import { Clips } from './Enums'; import { AudioMgr } from './AudioMgr'; import { CatAction } from './CatAction'; import { DataModel } from './DataModel'; import { AdManger } from './ad/AdManger'; const { ccclass, property } = _decorator; @ccclass('Props4Action') export class Props4Action extends Component { @property(Node) target:Node = null; @property(Sprite) cat_img:Sprite = null; color_arr = []; color_arr_index = 0; cat_action:CatAction @property({ type: Label }) conis_label: Label; start() { this.conis_label.string = Global.get_need_coins() + ""; for(let i = 0;i=1){ this.dt = 0; this.play_tween(); } } } private play_tween(){ this.color_arr_index++; if(this.color_arr_index>=this.color_arr.length){ this.color_arr_index = 0; } let c = this.color_arr[this.color_arr_index]; this.cat_img.color = new Color(c.r,c.g,c.b,255); } show_box(cat_action:CatAction){ this.cat_action = cat_action; } //开启一个盒子 open_box_coins(){ AudioMgr.ins.playSound(Clips.btn_1); if(Global.cur_coins { if (data == 1) { console.log("open_box_video 获取奖励成功"); this.node.parent.getComponent(PropsAction)?.close(); //解锁 this.cat_action.set_lock_unlock(false); this.cat_action.into_scence(new Vec2(0,400)); } else { Global.tips_action.show("获取奖励失败5"); //退款 // Global.return_used_cur_level_props_(4); } }) } open(){ this.conis_label.string = Global.get_need_coins() + ""; } }