62 lines
2.0 KiB
C#
62 lines
2.0 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace AppleHills.Data.CardSystem
|
|
{
|
|
/// <summary>
|
|
/// Scriptable object defining a collectible card's properties.
|
|
/// Used as a template for generating CardData instances.
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "New Card", menuName = "AppleHills/Card System/Card Definition")]
|
|
public class CardDefinition : ScriptableObject
|
|
{
|
|
[Header("Identification")]
|
|
[Tooltip("Unique identifier for this card definition")]
|
|
public string Id = Guid.NewGuid().ToString();
|
|
|
|
[Header("Basic Info")]
|
|
public string Name;
|
|
[TextArea(3, 5)]
|
|
public string Description;
|
|
public CardRarity Rarity;
|
|
public CardZone Zone;
|
|
|
|
[Header("Visual Elements")]
|
|
public Sprite CardImage; // The actual card image
|
|
|
|
[Header("Collection Info")]
|
|
public int CollectionIndex; // Position in the album
|
|
|
|
/// <summary>
|
|
/// Creates a new CardData instance from this definition
|
|
/// </summary>
|
|
public CardData CreateCardData()
|
|
{
|
|
return new CardData(this);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the background color for this card based on its zone
|
|
/// </summary>
|
|
public Color GetBackgroundColor()
|
|
{
|
|
// Colors based on zone
|
|
switch (Zone)
|
|
{
|
|
case CardZone.AppleHills:
|
|
return new Color(0.8f, 0.9f, 0.8f); // Light green
|
|
case CardZone.Quarry:
|
|
return new Color(0.85f, 0.8f, 0.7f); // Sandy brown
|
|
case CardZone.Forest:
|
|
return new Color(0.6f, 0.8f, 0.6f); // Forest green
|
|
case CardZone.Mountain:
|
|
return new Color(0.7f, 0.7f, 0.9f); // Bluish
|
|
case CardZone.Beach:
|
|
return new Color(0.9f, 0.85f, 0.7f); // Sandy yellow
|
|
default:
|
|
return Color.white;
|
|
}
|
|
}
|
|
}
|
|
}
|