Closed lorenalexm closed 3 years ago
The type Rect
is added in Assets\Examples\Source\Editor\CustomBinding.cs
in this example project. You could add your own CustomBinidng class (it will be automatically executed when generating code and d.ts)
PS: I've also moved this type into UnityBinding.cs (it's for some commonly used unity types)
Thank you for the prompt reply! I am away from my computer for the day, so it will be a bit before I can dig in and see about resolving my issue using the information you provided.
I do have a question about starting from a clean slate though. What all is required from this repo in a new project? What I am meaning, is if I am just wanting the most barebones setup to start from, are the files within the plover and fairygui truly required, or are they just there solely to support the samples and console that you have created?
Thank you again for your time!
My pleasure 😄 Yes, I see.
The only truely required files are Assets/jsb/**
.
And the files in Scripts/src/plover/**
are optional if you do not need the default implementation of editor scripting (you could even implement it by yourself).
All other files are scripts for demonstrating.
(BTW, the tsconfig.json/package.json stuff are also required, but it could not be simply copied depending on different situation of you own project.)
I'll rearrange the files in a better structure, write more doc comments in the code and write some related notes in README later.
I've rearranged the scripts to make it easier to use in a new project. I'll do more further works for this purpose later.
You can do some customization in js-bridge.json (or directly in Prefs.cs). For a new project, you can let editorEntryPoint = ""
and assetPostProcessors = empty list
. (Maybe I'd rewrite the comments in the code later for better comprehension)
I really appreciate the work you have, and continue to put into this project! I look forward to really being able to delve into things and see how far I am able to take it.
At this point I have added the Rect
binding to the UnityBinding.cs file as you have done, and all seems to be working smoothly for me. So that should close this issue. Thank you again for your help, and I look forward to seeing the updates you have planned!
I am attempting to create a new clean project to use unity-jsb within. After creating he new project within Unity Hub, I copied over the following files to the new project directory.
I did go through and clear the Scripts/src directory of all its files, leaving only the contents of the fairygui and plover folders. Following that, I ran the Generate Bindings and Type Definition from within the editor and created the following script within the source directory.
After which I ran
npm install
andtsc
. Running the compiler presented with the following error messages aboutRect
not being an exported member.Is there a step that I have completely overlooked here? The sample project seems to have ran just fine when from the cloned repository, but I cannot seem to make it work with a new project. Is there any guidance that could be provided? Thanks!