diff --git a/doc/source/getting-started/c-sharp.rst b/doc/source/getting-started/c-sharp.rst new file mode 100644 index 0000000..7af00c5 --- /dev/null +++ b/doc/source/getting-started/c-sharp.rst @@ -0,0 +1,67 @@ +.. _csharp: + +Using LimboAI with C# +===================== + +Here's how you can use the module version with C# to write your tasks and states. + +1. Locate LimboAI NuGet package files. + +Each provided build comes with a GodotSharp folder, which has packages under +"GodotSharp/Tools/nupkgs/". Note down the directory path; you'll need it in the next step. + +2. Add a local source for NuGet packages using the following command: + +.. code:: shell + + dotnet nuget add source path/to/limboai/nupkgs --name LimboNugetSource + +3. Your C# project should be able to see LimboAI classes and compile. + +Regarding GDExtension, I can only confirm success with the module version and C#. +Unfortunately, I haven't had any luck with the GDExtension version yet. +If you've had success with GDExtension, please let me know via Discord or email. + +Creating custom tasks in C# +--------------------------- + + **🛈 Note:** For more information, check out :ref:`creating custom tasks in GDScript `. + +You can use the following script template for custom tasks: + +.. code:: csharp + + using Godot; + using System; + + [Tool] + public partial class _CLASS_ : _BASE_ + { + public override string _GenerateName() + { + return "_CLASS_"; + } + + public override void _Setup() + { + } + + public override void _Enter() + { + } + + public override void _Exit() + { + } + + public override Status _Tick(double delta) + { + return Status.Success; + } + + public override string[] _GetConfigurationWarnings() + { + return Array.Empty(); + } + } + diff --git a/doc/source/index.rst b/doc/source/index.rst index aadc9de..fdc34cf 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -43,6 +43,7 @@ the other any time. For more information on this topic, see :ref:`gdextension`. getting-started/custom-tasks getting-started/using-blackboard getting-started/gdextension + getting-started/c-sharp getting-started/featured-classes .. toctree::