Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/limelight-mint/llm-visitors

[UniTask] [Extension] Simple extensions for halls-visitors system (e.g subscriber-notifier system) using UniTasks
https://github.com/limelight-mint/llm-visitors

csharp extension llm-modules modules shortcut ticker tickrate ticks unitask unity update

Last synced: about 1 month ago
JSON representation

[UniTask] [Extension] Simple extensions for halls-visitors system (e.g subscriber-notifier system) using UniTasks

Awesome Lists containing this project

README

        

# LLM-Visitors
[UniTask] [Extension] Shortcut for 1-to-100 tickrate halls-visitors system (e.g subscriber-notifier system)

### Ok but how to actually use it?
> Required UniTask itself, so first-thing-first install a .unitypackage from this link.
> Can be used for default .NET classes if you install UniTask as NuGet package. Also feel free to change whatever you want or collab.

Simple example of our `Discord Overlay Service` being one of many `IVisitor` instances that is inside `MonoHall` ticking with custom tickrate:
```
using Cysharp.Threading.Tasks;
using LLM.Visitors.Base;
using LLM.Services.DiscordWrapper;

namespace LLM.Visitors
{
public class DiscordVisitor : IVisitor
{
private DiscordService service;

public DiscordVisitor(DiscordService service)
{
service.Initialize();
service.LookupForDiscordClient();
}

public UniTask OnVisitorEnter() => service.EnableOverlay();
public UniTask OnVisitorLeave() => service.DisposeOverlay();

public void OnTick() => service.PerformOverlayTicks();
}
}
```

Our `Service Collection` has initialized `MonoHall` instance:
> [!TIP]
> You can create new `IHall` inheritance that is NOT a MonoBehaviour (like `public class ClockService : IHall`) and you can start it once somewhere ticking with tickrate you want, its all up to you we just showing u a simplest way

```
[SerializeField] private MonoHall hall;
...

private void InitializeHall(ServiceCollection services)
{
hall.Enter(new DiscordVisitor(services.Get()));
hall.Enter(new FireabseVisitor(services.Get()));
hall.Enter(new DevConsoleVisitor());
hall.Enter(new LogTesterVisitor());

DontDestroyOnLoad(hall);
}
```

> [!TIP]
> Here is how we set it up, making ServiceCollection new additional Scene which holds our services and IHall component, so we can swap scenes and do whatever we want when those two will sit there and provide us a support when we need it.
> Can be done better by making it just plain C# classes ofc, yet its just an example.

![MonoHall Setup Picture](https://bunbun.cloud/assets/images/git/monoHall1.png)

![MonoHall Setup Picture](https://bunbun.cloud/assets/images/git/monoHall2.png)