Friday, July 22, 2022
HomeGame DevelopmentFind out how to use internet employee in typescript cc 3.5.1? -...

Find out how to use internet employee in typescript cc 3.5.1? – Cocos Creator


Hello everybody, I’m having downside utilizing internet employee in cocos.
I’ve file a.ts and file employee.ts. How am i able to import file a.ts into employee.ts ? I attempt to use importScripts(a.js) but it surely’s not work as a result of importScripts will not be outlined.


I could be off with what you’re asking however if you wish to import one other script I’ve achieved it like this.

import { yourscript } from './a';

Then you possibly can name like:

yourscript.someVariable

I’ve file primary.ts like this

import  MyWorker from `../MyWorker'
 const code = MyWorker.toString();
    const blob = new Blob([`(${code})()`]);
    const employee = new Employee(URL.createObjectURL(blob));

file MyWorker like this

import AnotherFile from '.../AnotherFile';

export default () => {
  console.log(take a look at, AnotherFile); // error right here
};

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments