FTipsEvent.ts 781 B

12345678910111213141516171819202122232425262728293031323334
  1. import i18n from "../../../../i18n/i18n";
  2. import ViewObject from "../../../../main/ViewObject";
  3. /**
  4. * 机关无法通关的提示
  5. * 目前只有选颜色的地方使用
  6. */
  7. const {ccclass, property} = cc._decorator;
  8. @ccclass
  9. export default class FTipsEvent extends ViewObject {
  10. @property(cc.Label)
  11. mLabel: cc.Label = null;
  12. @property(cc.Label)
  13. mBtName: cc.Label = null;
  14. /**
  15. * 点击查看提示回调
  16. */
  17. public onclickCallback:()=>void;
  18. public init(btName:string,about:string){
  19. this.mBtName.string = i18n.t(btName)
  20. this.mLabel.string = i18n.t(about)
  21. }
  22. public setCallback(onclickCallback:()=>void){
  23. this.onclickCallback = onclickCallback
  24. }
  25. public onclick(){
  26. this.onclickCallback()
  27. }
  28. }