/*
using UnityEngine;
using AppleHills.Data.CardSystem;
using System.Collections.Generic;
using UnityEditor;
using Data.CardSystem;
using Core;
using UI.CardSystem;
using UnityEngine.UI;
namespace AppleHills.Tests
{
///
/// Testing component for the Card System. Provides editor buttons to test core functionalities.
/// Place this in a test scene to easily test card system features without needing full game implementation.
///
public class CardSystemTester : MonoBehaviour
{
// [Header("References")]
[SerializeField] private GameObject cardAlbumUI;
[Header("Test Settings")]
[SerializeField] [Range(1, 10)] private int boosterPacksToAdd = 3;
[SerializeField] [Range(1, 100)] private int cardsToGenerate = 10;
[SerializeField] private bool autoOpenPacksWhenAdded = false;
[Header("Debug Info")]
[SerializeField] [ReadOnly] private int currentBoosterCount;
[SerializeField] [ReadOnly] private int totalCardsInCollection;
[SerializeField] [ReadOnly] private string lastActionMessage;
private void Awake()
{
// // Auto-find references if needed
// if (cardAlbumUI == null)
// cardAlbumUI = FindAnyObjectByType();
//
// // Log missing references
// if (cardAlbumUI == null)
// Debug.LogError("CardSystemTester: No CardAlbumUI found in the scene!");
}
private void Start()
{
RefreshDebugInfo();
}
// Refresh the debug information displayed in the inspector
private void RefreshDebugInfo()
{
// Access CardSystemManager through the singleton Instance
if (CardSystemManager.Instance != null)
{
currentBoosterCount = CardSystemManager.Instance.GetBoosterPackCount();
totalCardsInCollection = CardSystemManager.Instance.GetCardInventory().GetAllCards().Count;
}
}
#if UNITY_EDITOR
// Custom editor buttons for testing
public void AddBoosterPacks()
{
// Access CardSystemManager through the singleton Instance
if (CardSystemManager.Instance != null)
{
CardSystemManager.Instance.AddBoosterPack(boosterPacksToAdd);
lastActionMessage = $"Added {boosterPacksToAdd} booster pack(s)";
Logging.Debug($"[CardSystemTester] {lastActionMessage}");
RefreshDebugInfo();
if (autoOpenPacksWhenAdded && cardAlbumUI != null)
{
SimulateBackpackClick();
cardAlbumUI.OpenBoosterPack();
}
}
}
public void SimulateBackpackClick()
{
if (cardAlbumUI != null)
{
// This will show the main card menu
// Manually trigger a click on the backpack icon
// Note: This relies on the backpack icon being correctly set up in the CardAlbumUI
if (cardAlbumUI.BackpackIcon != null)
{
Button backpackButton = cardAlbumUI.BackpackIcon.GetComponent