Editor setup
This page sets up Visual Studio Code for C# scripting. Other editors work too. The key is pointing IntelliSense at the engine assembly.
What you get
Section titled “What you get”Kolpa scripts are C# classes that derive from Kolpa.Engine.MonoBehaviour. Your editor gets full autocomplete and type checking against the real engine API when it sees Kolpa.Engine.dll.
The API surface is the public code in bindings/Kolpa.Engine/. There are no generated stub files. The assembly is the truth.
VS Code setup
Section titled “VS Code setup”- Install the C# Dev Kit extension (publisher Microsoft). It bundles the C# extension and OmniSharp/Roslyn.
- File -> Open Folder and choose the engine source root (the folder that contains
bindings/). Scripts compile from the source tree today. - Open any
.csfile underbindings/Kolpa.Demo/. The C# extension reads the.csprojnext to it and resolvesKolpa.Engineautomatically. - Type
transform.orgameObject.and you should see members.
If autocomplete is missing
Section titled “If autocomplete is missing”Confirm the C# extension loaded and that bindings/Kolpa.Demo/Kolpa.Demo.csproj builds. The build copies Kolpa.Engine.dll next to the demo assembly. If the reference is unresolved, build once so the DLL exists.
Where scripts live
Section titled “Where scripts live”bindings/Kolpa.Engine/: the engine API. Read it, do not edit it unless you are changing the engine.bindings/Kolpa.Demo/: your scripts. Add new.csfiles here. The build compiles this folder intoKolpa.Demo.dll.
Start a new script from bindings/Kolpa.Demo/NewBehaviour.cs.template. Copy it, rename the class to match the file, then attach it through the Script component.
Continue reading
Section titled “Continue reading”Previous: Scripting overview: lifecycle and attaching scripts.
Next: Gameplay scripts: logic attached to one GameObject.
