I'm having some problem with inheritance, when saving it to prefabs.
I have two classes:
class A
{
public virtual void Call()
{
Debug.Log("Hello A");
}
}
class B : A
{
public override void Call()
{
Debug.Log("Hello B");
}
}
I then create an empty prefab, create a game object, add a simple script to hold my object of type B, and lastly replace the prefab with my game object (all done with a script).
The simple script will in Awake do this: `someObj.Call();`
If I do this on runtime. That is create empty prefab, and so on. Then it will output: "Hello B".
If I do this on editortime, and then add the created prefab to the scene. Then it will output: "Hello A".
So my question is: How do I get around this problem, without creating several lists for each type?
Eh, this is something new for me. I gotta try reproduce it when I get back later tonight. oO
– StatementWell, its also new for me :-) Still looking for a solution.
– Ejlersen