-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathNeuroSdkSetup.cs
More file actions
27 lines (25 loc) · 957 Bytes
/
NeuroSdkSetup.cs
File metadata and controls
27 lines (25 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#nullable enable
using NeuroSdk.Actions;
using NeuroSdk.Websocket;
using UnityEngine;
namespace NeuroSdk
{
// ReSharper disable once PartialTypeWithSinglePart UnusedType.Global
public static partial class NeuroSdkSetup
{
/// <summary>
/// Use this only if you haven't already added the NeuroSdk prefab in your scenes.
/// </summary>
/// <param name="game"></param>
// ReSharper disable once UnusedMember.Global
public static void Initialize(string game)
{
GameObject obj = new("NeuroSdk") { hideFlags = HideFlags.HideAndDontSave };
WebsocketConnection connection = obj.AddComponent<WebsocketConnection>();
connection.game = game;
connection.messageQueue = obj.AddComponent<MessageQueue>();
connection.commandHandler = obj.AddComponent<CommandHandler>();
obj.AddComponent<NeuroActionHandler>();
}
}
}