Skip to content

Commit

Permalink
added Examples.DemoSupports
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed Oct 28, 2024
1 parent c2b764a commit 3fc7cbd
Show file tree
Hide file tree
Showing 11 changed files with 580 additions and 418 deletions.
36 changes: 28 additions & 8 deletions Editor/UniNetty.Editor/UniNettyExampleWindow.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
using UniNetty.Examples.Discard.Client;
using UniNetty.Examples.Discard.Server;
using System;
using System.Collections.Generic;
using UniNetty.Examples.DemoSupports;
using UnityEditor;
using UnityEngine;

namespace UniNetty.Editor
{
public class UniNettyExampleWindow : EditorWindow
{
public void ExampleDiscard()
private Dictionary<UniNettyExampleType, UniNettyExample> _examples;

private void OnDisable()
{
var server = new DiscardServer();
var client = new DiscardClient();
foreach (var knv in _examples)
{
knv.Value?.Stop();
}

_examples.Clear();
_examples = null;
}


private void OnEnable()
{
var ip = UniNettyExampleSupports.GetPrivateIp();
_examples = UniNettyExampleSupports.CreateDefaultExamples(null, ip);
}

// GUI 그리기
private void OnGUI()
{
if (GUILayout.Button("Discard"))
if (GUILayout.Button("Discard Server"))
{
ExampleDiscard();
_examples[UniNettyExampleType.Discard].ToggleServer();
}

if (GUILayout.Button("Discard Client"))
{
_examples[UniNettyExampleType.Discard].ToggleClient();
}

}
}
}
209 changes: 0 additions & 209 deletions Examples/UniNetty.Examples.DemoSupports/ExampleContext.cs

This file was deleted.

89 changes: 0 additions & 89 deletions Examples/UniNetty.Examples.DemoSupports/ExampleSetting.cs

This file was deleted.

Loading

0 comments on commit 3fc7cbd

Please sign in to comment.