This commit is contained in:
2026-08-21 17:59:13 +03:00
parent b98901c366
commit f6a7547e84
951 changed files with 909007 additions and 70938 deletions
@@ -7,6 +7,8 @@ public static class MapRadarNetworkSetup
{
private const string LeverPrefabPath =
"Assets/CONTENT/Game/Prefabs/Interaction/PhysicalLever.prefab";
private const string EnemyBalancePath =
"Assets/CONTENT/FEATURES/MapRadar/Configs/MapEnemyBalance.asset";
[MenuItem("FORT-BO/Map Radar/Configure Network Prototype")]
public static void ConfigureNetworkPrototype()
@@ -31,6 +33,7 @@ public static class MapRadarNetworkSetup
GetOrAdd<NetworkObject>(mapController.gameObject);
NetworkBaseHealth baseHealth = GetOrAdd<NetworkBaseHealth>(mapController.gameObject);
MapControlBinder binder = GetOrAdd<MapControlBinder>(mapController.gameObject);
MapEnemyBalanceConfig enemyBalance = GetOrCreateEnemyBalance();
Transform controlsRoot = GetOrCreateChild(
mapController.transform.root,
@@ -62,6 +65,7 @@ public static class MapRadarNetworkSetup
SetObject(map, "roundGameLoop",
Object.FindFirstObjectByType<RoundGameLoopController>());
SetObject(map, "baseHealth", baseHealth);
SetObject(map, "enemyBalance", enemyBalance);
map.ApplyModifiedPropertiesWithoutUndo();
SerializedObject binding = new(binder);
@@ -82,10 +86,24 @@ public static class MapRadarNetworkSetup
Debug.Log(
"[Map] Network prototype configured: X/Y wheels, fire lever, " +
"scan button and base health are connected.",
"scan button, enemy balance and base health are connected.",
mapController);
}
private static MapEnemyBalanceConfig GetOrCreateEnemyBalance()
{
MapEnemyBalanceConfig config =
AssetDatabase.LoadAssetAtPath<MapEnemyBalanceConfig>(EnemyBalancePath);
if (config != null)
return config;
config = ScriptableObject.CreateInstance<MapEnemyBalanceConfig>();
AssetDatabase.CreateAsset(config, EnemyBalancePath);
EditorUtility.SetDirty(config);
AssetDatabase.SaveAssets();
return config;
}
private static NetworkPhysicalWheelInteractable CreateWheel(
Transform parent,
string name,