-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
580 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
209
Examples/UniNetty.Examples.DemoSupports/ExampleContext.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.