This new battle action system provides a radial decision wheel for selecting character actions including:
Add these components to your BattleScene:
BattleActionSystem - Main system controller
BattleActionWheel - The radial menu UI
BattleActionIntegration - Connects new and old systems
Canvas (BattleActionWheel)
├── WheelBackground (Image)
└── WheelCenter (Empty GameObject)
└── ActionButtons (will be created automatically)
Create a prefab with this structure:
ActionButton (Button + Image)
├── Icon (Image)
└── Label (TextMeshPro)
Use the ActionButtonCreator.CreateActionButton() method to create buttons programmatically.
The new system can run alongside your existing click-drag system:
BattleActionIntegration.ToggleActionSystem()No changes needed to existing Character prefabs! The system will:
Character Selection:
// Manual selection
battleActionIntegration.SelectCharacter(character);
// Or click on character in game
Action Selection:
Action Execution:
// Execute single character
battleActionSystem.ExecuteCharacterAction(character);
// Execute all players (turn-based)
battleActionIntegration.ExecuteAllPlayerActions();
ShowActionWheel(Character) - Display action wheelExecuteCharacterAction(Character) - Execute selected actionOnActionStarted, OnActionCompletedShowWheel(Character, Vector3) - Show at world positionHideWheel() - Hide the wheelOnActionSelected, OnWheelClosedSelectCharacter(Character) - Select for actionExecuteAllPlayerActions() - Execute all player actionsResetAllPlayerActions() - Clear all actions for new turnAllPlayersHaveActions() - Check if all players readypublic enum BattleActionType
{
Move, // Position targeting
Attack, // Enemy targeting
UseItem, // Item selection + optional targeting
CastSpell, // Spell selection + optional targeting
Defend, // No targeting needed
Wait, // No targeting needed
RunAway // No targeting needed
}
// Access character's action data
var actionData = character.enhancedActionData as EnhancedCharacterActionData;
if (actionData != null && actionData.hasValidAction)
{
Debug.Log($"Action: {actionData.GetActionDescription()}");
}
BattleActionType enumBattleActionWheel.CreateActionButtons()BattleActionSystem.ExecuteActionCoroutine()BattleActionSystemReplace placeholder implementations in:
ItemSelectionUI.GetCharacterItems()SpellSelectionUI.GetCharacterSpells()BattleActionSystem.UseItem()BattleActionSystem.CastSpell()BattleActionWheelActionButtonCreatorUse the debug UI (visible when useNewActionSystem = true):
The system includes extensive debug logging with emoji prefixes:
// Force show action wheel
battleActionSystem.ShowActionWheel(character);
// Check action status
Debug.Log(character.enhancedActionData?.GetActionDescription());
// Reset if stuck
battleActionIntegration.ResetAllPlayerActions();
This system provides a solid foundation for complex battle actions while maintaining compatibility with your existing combat system!