InteractiveUtil.ts 730 B

12345678910111213141516171819202122232425262728293031
  1. import { Component } from "cc";
  2. import { Framework } from "../Framework";
  3. export class InteractiveUtil {
  4. /**
  5. * 添加事件
  6. * @param data 需要的参数数据
  7. * @param name 参数名
  8. * @param back 方法回调
  9. */
  10. // postData(mod, act,data,paramArr:Array<string>,back:Function) {
  11. // if(data){
  12. // back()
  13. // }else{
  14. // console.log(mod+`中${act}返回数据找不到的`);
  15. // }
  16. // }
  17. postData(data, name, back: Function) {
  18. if (data) {
  19. back()
  20. } else {
  21. console.log(name + '返回数据找不到');
  22. Framework.tips.setTips('error')
  23. }
  24. }
  25. }
  26. export let IntaUtil = new InteractiveUtil;