코드 경고 제거 및 미사용 코드 제거
This commit is contained in:
@@ -228,7 +228,7 @@ namespace Northbound.Editor
|
||||
|
||||
private static void AutoConfigureBuildingManager()
|
||||
{
|
||||
BuildingManager buildingManager = GameObject.FindObjectOfType<BuildingManager>();
|
||||
BuildingManager buildingManager = GameObject.FindFirstObjectByType<BuildingManager>();
|
||||
|
||||
if (buildingManager == null)
|
||||
{
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Northbound.Editor
|
||||
{
|
||||
public class QuickNetworkSetupEditor
|
||||
{
|
||||
[MenuItem("Tools/Network/Quick Setup for IP Connection")]
|
||||
public static void QuickSetup()
|
||||
{
|
||||
bool disableAutoHost = EditorUtility.DisplayDialog(
|
||||
"Quick Network Setup",
|
||||
"This will set up your scene for manual IP-based network connections.\n\n" +
|
||||
"It will:\n" +
|
||||
"- Create a NetworkConnectionHelper component\n" +
|
||||
"- Disable AutoHost (to prevent auto-start)\n\n" +
|
||||
"Do you want to disable AutoHost?",
|
||||
"Yes, disable AutoHost",
|
||||
"No, keep AutoHost"
|
||||
);
|
||||
|
||||
CreateNetworkHelper();
|
||||
|
||||
if (disableAutoHost)
|
||||
{
|
||||
DisableAutoHost();
|
||||
}
|
||||
|
||||
EditorUtility.DisplayDialog(
|
||||
"Setup Complete",
|
||||
"Quick network setup complete!\n\n" +
|
||||
"Next steps:\n" +
|
||||
"1. Open Window > Network > Connection Manager\n" +
|
||||
"2. Or use the NetworkConnectionHelper in Inspector\n" +
|
||||
"3. Start Host on one instance\n" +
|
||||
"4. Start Client on other instances with the Host's IP",
|
||||
"OK"
|
||||
);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Network/Create Connection Helper")]
|
||||
public static void CreateNetworkHelper()
|
||||
{
|
||||
if (Object.FindObjectOfType<NetworkConnectionHelper>() == null)
|
||||
{
|
||||
GameObject helperObj = new GameObject("NetworkConnectionHelper");
|
||||
helperObj.AddComponent<NetworkConnectionHelper>();
|
||||
Selection.activeGameObject = helperObj;
|
||||
Debug.Log("[QuickNetworkSetup] NetworkConnectionHelper created");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[QuickNetworkSetup] NetworkConnectionHelper already exists");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Network/Disable AutoHost")]
|
||||
public static void DisableAutoHost()
|
||||
{
|
||||
AutoHost[] autoHosts = Object.FindObjectsByType<AutoHost>(FindObjectsSortMode.None);
|
||||
if (autoHosts.Length > 0)
|
||||
{
|
||||
foreach (var autoHost in autoHosts)
|
||||
{
|
||||
autoHost.enabled = false;
|
||||
}
|
||||
Debug.Log($"[QuickNetworkSetup] Disabled {autoHosts.Length} AutoHost component(s)");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[QuickNetworkSetup] No AutoHost components found");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Network/Enable AutoHost")]
|
||||
public static void EnableAutoHost()
|
||||
{
|
||||
AutoHost[] autoHosts = Object.FindObjectsByType<AutoHost>(FindObjectsSortMode.None);
|
||||
if (autoHosts.Length > 0)
|
||||
{
|
||||
foreach (var autoHost in autoHosts)
|
||||
{
|
||||
autoHost.enabled = true;
|
||||
}
|
||||
Debug.Log($"[QuickNetworkSetup] Enabled {autoHosts.Length} AutoHost component(s)");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[QuickNetworkSetup] No AutoHost components found");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d84f5c07a6e69614dad5178e0f994335
|
||||
@@ -54,7 +54,7 @@ namespace Northbound.Editor
|
||||
}
|
||||
}
|
||||
|
||||
BuildingManager buildingManager = GameObject.FindObjectOfType<BuildingManager>();
|
||||
BuildingManager buildingManager = GameObject.FindFirstObjectByType<BuildingManager>();
|
||||
Debug.Log($"<color=cyan>BuildingManager in Scene:</color>");
|
||||
if (buildingManager == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user