64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
using System;
|
|
using FlaxEngine;
|
|
using Console = Game.Console;
|
|
#if FLAX_EDITOR
|
|
using System.Diagnostics;
|
|
using FlaxEditor;
|
|
#endif
|
|
|
|
namespace Game
|
|
{
|
|
public class NetworkManagerPlugin : GGamePlugin
|
|
{
|
|
public override Type[] PluginDependencies { get => new Type[] { typeof(ConsolePlugin) }; }
|
|
|
|
public static PluginDescription DescriptionInternal = new PluginDescription
|
|
{
|
|
Author = "Ari Vuollet",
|
|
Name = "NetworkManager",
|
|
Description = "NetworkManager for Goake",
|
|
Version = Version.Parse("0.1.0"),
|
|
IsAlpha = true,
|
|
Category = "Game"
|
|
};
|
|
|
|
public override void Init()
|
|
{
|
|
//FlaxEngine.Debug.Log("NetworkManagerPlugin initialized");
|
|
NetworkManager.Init();
|
|
}
|
|
}
|
|
|
|
#if FLAX_EDITOR
|
|
public class NetworkManagerEditorPlugin : GEditorPlugin
|
|
{
|
|
public override Type[] PluginDependencies { get => new Type[] { typeof(ConsoleEditorPlugin) }; }
|
|
|
|
public override Type GamePluginType => typeof(NetworkManagerPlugin);
|
|
|
|
public NetworkManagerEditorPlugin()
|
|
{
|
|
_description = NetworkManagerPlugin.DescriptionInternal;
|
|
}
|
|
|
|
public override void Init()
|
|
{
|
|
//FlaxEngine.Debug.Log("NetworkManagerPlugin initialized");
|
|
//Console.Init();
|
|
//NetworkManager.Init();
|
|
|
|
FlaxEditor.Editor.Instance.PlayModeBegin += OnPlayModeBegin;
|
|
}
|
|
|
|
public override void Deinit()
|
|
{
|
|
//FlaxEditor.Editor.Instance.PlayModeBegin -= OnPlayModeBegin;
|
|
}
|
|
|
|
private void OnPlayModeBegin()
|
|
{
|
|
NetworkManager.Init();
|
|
}
|
|
}
|
|
#endif
|
|
} |