ScriptableObject with instance-attached script
Hello there. I'm looking for help, because i want to create a very specific type of data.
For my game, i need Effect concept.
Let's say we imagine a first effect :
Fire. Fire deals damage to target for 10 sec each second.
Benumbed. Benumbed modify the speed stat of target for 6 sec.
I have multiple other idea and i'm trying to make an optimized workflow, allowing to quickly create new effects.
In some ways ScriptableObjects are exactly what i want. But the main con of it is that i cannot write an instance attached script. All Effects have share the common point of having a duration between 0 and infinity and they all have an OnApply function that just make things happend.
Here is the problem. While the duration is easy to serialize, allowing me to set a duration for each different effect, i cannot easily serialize the OnApply function, or callback.
What i want is a ScriptableObject, where i can write a specific and different callback for each individual instance of it.
Is it possible ? Any advice ?
Your answer
![](https://koobas.hobune.stream/wayback/20220612211939im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to convert object types? 0 Answers
Assign ScriptableObject (Inventory DataBase) 0 Answers
Static function not working in between screen 2 Answers
If statement not working. 0 Answers
why the Timer isn't working 0 Answers