Add backbone for card creation and implement Camera minigame mechanics
This commit is contained in:
61
Assets/Scripts/Data/CardSystem/CardDefinition.cs
Normal file
61
Assets/Scripts/Data/CardSystem/CardDefinition.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
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 = "Apple Hills/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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user