Google.ts 488 B

123456789101112131415161718192021
  1. import { ANDROID, IOS } from "cc/env";
  2. import { GoogleImpl } from "./GoogleImpl";
  3. import { GoogleAndroidImpl } from "./GoogleAndroidImpl";
  4. import { GoogleIOSImpl } from "./GoogleIOSImpl";
  5. import { GoogleH5Impl } from "./GoogleH5Impl";
  6. function getGoogleImpl(): GoogleImpl {
  7. if (ANDROID) {
  8. return new GoogleAndroidImpl();
  9. }
  10. if (IOS) {
  11. return new GoogleIOSImpl();
  12. }
  13. return new GoogleH5Impl();
  14. }
  15. const google = getGoogleImpl();
  16. export default google;