42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
#if UNITY_EDITOR
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace MegaKoop.EditorTools
|
|
{
|
|
public static class ProjectSetupTools
|
|
{
|
|
[MenuItem("Tools/MegaKoop/Steam/Enable 'STEAMWORKSNET' Define", priority = 5)]
|
|
public static void EnableSteamworksDefine()
|
|
{
|
|
var group = EditorUserBuildSettings.selectedBuildTargetGroup;
|
|
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
|
|
if (!defines.Contains("STEAMWORKSNET"))
|
|
{
|
|
if (!string.IsNullOrEmpty(defines)) defines += ";";
|
|
defines += "STEAMWORKSNET";
|
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
|
|
Debug.Log($"[Setup] Added 'STEAMWORKSNET' define to {group}. Recompiling...");
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("[Setup] 'STEAMWORKSNET' already present.");
|
|
}
|
|
}
|
|
|
|
[MenuItem("Tools/MegaKoop/Steam/Show Setup Instructions", priority = 6)]
|
|
public static void ShowSteamSetupInstructions()
|
|
{
|
|
Debug.Log(
|
|
"STEAM SETUP:\n" +
|
|
"1) Install Steamworks.NET (Package/Asset).\n" +
|
|
"2) Run Tools > MegaKoop > Steam > Enable 'STEAMWORKSNET' Define.\n" +
|
|
"3) Ensure Steam client is running.\n" +
|
|
"4) Optional: place steam_appid.txt (e.g., 480) beside the built .exe for local builds.\n" +
|
|
"5) Press Play. Host -> Invite overlay opens automatically."
|
|
);
|
|
}
|
|
}
|
|
}
|
|
#endif
|