Doc: Add C# instructions

This commit is contained in:
Serhii Snitsaruk 2024-02-14 19:56:19 +01:00
parent fcedf681cd
commit be0b5233c0
2 changed files with 68 additions and 0 deletions

View File

@ -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 <custom_tasks>`.
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<string>();
}
}

View File

@ -43,6 +43,7 @@ the other any time. For more information on this topic, see :ref:`gdextension`.
getting-started/custom-tasks getting-started/custom-tasks
getting-started/using-blackboard getting-started/using-blackboard
getting-started/gdextension getting-started/gdextension
getting-started/c-sharp
getting-started/featured-classes getting-started/featured-classes
.. toctree:: .. toctree::