TTSdkComponent.ts 572 B

1234567891011121314151617181920
  1. import { Ad } from "./Ad";
  2. const { ccclass, property } = cc._decorator;
  3. declare var wx: any;
  4. @ccclass
  5. export default class TTSdkComponent extends cc.Component {
  6. @property({ type: Ad, displayName: "广告模块" })
  7. ad: Ad = new Ad();
  8. sendToNative(arg0: string, arg1?: string) {
  9. jsb.reflection.callStaticMethod("com/yiyuancoder/ttsdk/TTSdkComponent", "sendToNative", "(Ljava/lang/String;Ljava/lang/String;)V", arg0, arg1);
  10. }
  11. showToast(content: string) {
  12. this.sendToNative('showToast', JSON.stringify({ content: content }));
  13. }
  14. }