Simple Pigman AI

This commit is contained in:
Michal Pikulski
2025-12-04 08:52:59 +01:00
committed by Michal Pikulski
parent e60d516e7e
commit edb83ef13d
27 changed files with 7452 additions and 428 deletions

View File

@@ -9,7 +9,7 @@ namespace AppleHills.Core.Settings.Editor
{
private Vector2 scrollPosition;
private List<BaseDeveloperSettings> allDeveloperSettings = new List<BaseDeveloperSettings>();
private string[] tabNames = new string[] { "Diving", "Debug", "Other Systems" }; // Added Debug tab
private string[] tabNames = new string[] { "Diving", "Fort Fight", "Debug", "Other Systems" };
private int selectedTab = 0;
private Dictionary<string, SerializedObject> serializedSettingsObjects = new Dictionary<string, SerializedObject>();
private GUIStyle headerStyle;
@@ -45,6 +45,7 @@ namespace AppleHills.Core.Settings.Editor
// If any settings are missing, create them
CreateSettingsIfMissing<DivingDeveloperSettings>("DivingDeveloperSettings");
CreateSettingsIfMissing<FortFightDeveloperSettings>("FortFightDeveloperSettings");
CreateSettingsIfMissing<DebugSettings>("DebugSettings");
// Add more developer settings types here as needed
@@ -114,10 +115,13 @@ namespace AppleHills.Core.Settings.Editor
case 0: // Diving
DrawSettingsEditor<DivingDeveloperSettings>();
break;
case 1: // Debug
case 1: // Fort Fight
DrawSettingsEditor<FortFightDeveloperSettings>();
break;
case 2: // Debug
DrawSettingsEditor<DebugSettings>();
break;
case 2: // Other Systems
case 3: // Other Systems
EditorGUILayout.HelpBox("Other developer settings will appear here as they are added.", MessageType.Info);
break;
// Add additional cases as more developer settings types are added

View File

@@ -10,11 +10,16 @@ namespace AppleHills.Editor
[InitializeOnLoad]
public static class EditorSettingsProvider
{
// Gameplay Settings
private static PlayerFollowerSettings _playerFollowerSettings;
private static InteractionSettings _interactionSettings;
private static DivingMinigameSettings _divingMinigameSettings;
private static Minigames.FortFight.Core.FortFightSettings _fortFightSettings;
// Developer Settings
private static FortFightDeveloperSettings _fortFightDeveloperSettings;
private static DivingDeveloperSettings _divingDeveloperSettings;
// Static constructor will be called when Unity loads/reloads scripts
static EditorSettingsProvider()
{
@@ -54,11 +59,16 @@ namespace AppleHills.Editor
public static void LoadAllSettings()
{
// Load gameplay settings
_playerFollowerSettings = AssetDatabase.LoadAssetAtPath<PlayerFollowerSettings>("Assets/Settings/PlayerFollowerSettings.asset");
_interactionSettings = AssetDatabase.LoadAssetAtPath<InteractionSettings>("Assets/Settings/InteractionSettings.asset");
_divingMinigameSettings = AssetDatabase.LoadAssetAtPath<DivingMinigameSettings>("Assets/Settings/MinigameSettings.asset");
_fortFightSettings = AssetDatabase.LoadAssetAtPath<Minigames.FortFight.Core.FortFightSettings>("Assets/Settings/FortFightSettings.asset");
// Load developer settings
_fortFightDeveloperSettings = AssetDatabase.LoadAssetAtPath<FortFightDeveloperSettings>("Assets/Settings/Developer/FortFightDeveloperSettings.asset");
_divingDeveloperSettings = AssetDatabase.LoadAssetAtPath<DivingDeveloperSettings>("Assets/Settings/Developer/DivingDeveloperSettings.asset");
// Re-register the delegates in case they were lost
AppleHills.SettingsAccess.SetupEditorProviders(
GetPlayerStopDistance,
@@ -112,5 +122,18 @@ namespace AppleHills.Editor
return null;
}
/// <summary>
/// Get developer settings in editor mode (for OnDrawGizmos, etc.)
/// </summary>
public static T GetDeveloperSettings<T>() where T : BaseDeveloperSettings
{
if (typeof(T) == typeof(FortFightDeveloperSettings))
return _fortFightDeveloperSettings as T;
else if (typeof(T) == typeof(DivingDeveloperSettings))
return _divingDeveloperSettings as T;
return null;
}
}
}