I have this ScriptableObject and I would like to add an effect to each card at creation; I have a script called "EffectManager" that has some methods as effects.
This is my card script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "New Card", menuName = "Card")]
public class Card : ScriptableObject
{
public string m_cardName;
public Sprite m_sprite;
public int m_manaCost;
public int m_health;
public int m_attack;
}
and this is my EffectManager Script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EffectManager : MonoBehaviour
{
Deck dk;
Hand hnd;
Player p1;
private void Awake()
{
dk = GameObject.FindObjectOfType<Deck>();
hnd = GameObject.FindObjectOfType<Hand>();
jg1 = GameObject.FindObjectOfType<Player>();
}
public void draw(int num)
{
jg1.DrawCards(num);
}
public void discard()
{
hnd.hand.RemoveAt(0);
}
private void mill()
{
dk.deck.RemoveAt(0);
}
}
How can I make so each card I create has an effect linked to it that activates when conditions are met? (in this case it would be when the card is summoned)