12345678910111213141516171819202122232425262728293031323334 |
- import i18n from "../../i18n/i18n";
- import CUtil from "../../util/CUtil";
- import { __GoodData } from "../data/sdata/SManage";
- import FTmpTaskGood from "./FTmpTaskGood";
- /**
- * 临时道具面板显示
- */
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class FTmpTaskPanel extends cc.Component {
- @property(cc.Label)
- mName: cc.Label = null;
- @property(cc.Label)
- mAbout: cc.Label = null;
- public time = 0
- public show(goodItem:FTmpTaskGood){
- this.node.active = true
- this.mName.string = i18n.t(goodItem._good.name) + 'X'+goodItem.count
- this.mAbout.string = i18n.t(goodItem._good.about)
- this.time = CUtil.getNowTime()
- }
- update (dt) {
- let nowTime = CUtil.getNowTime()
- if(nowTime - this.time > 2){
- this.node.active = false
- }
- }
- }
|