Can I use C# scripts in needle scene?

How can I use my c# scripts in needle engine? Is there a way to enable c# compiling?

Hi Saad Baig,

In Needle Engine, you can’t directly use C# scripts. Instead, Needle Engine utilizes TypeScript or JavaScript for scripting purposes. When working within Unity, Needle Engine can generate C# stub components from the TypeScript scripts you write, allowing you to attach these scripts to GameObjects within Unity.

Here’s a brief overview of how this works:

  1. Write Scripts in TypeScript: You create your components as TypeScript files in your project’s src/scripts/ directory. These scripts will define the behavior you want to implement.

  2. Automatic C# Stub Generation: Needle Engine generates corresponding C# stub components to represent your TypeScript behavior scripts within the Unity Editor. This allows you to configure and attach the components in Unity, while the actual logic executes as JavaScript.

  3. Compilation to JavaScript: At runtime, the Needle Engine transforms these components into JavaScript. The C# scripts are mainly used for editing purposes within Unity (see scripting) (see component compiler) (see component compiler).

If you need to integrate complex functionalities originally written in C#, you may need to convert critical parts to TypeScript or use the Needle Engine’s web technologies and APIs to achieve similar results.

For more detailed information, you can check the Needle Engine documentation: Needle Engine Documentation.

Feel free to ask more specific questions or provide more details if you have particular requirements in mind!

24 replies left
thread_O8cStB1KXwoxGa6sDtfgaw6f
Reply to this message to continue the conversation

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.