I saw this:
So I basically built two classes one my abstract class as such:
public abstract class TriggeredScript : MonoBehaviour
{
public abstract void RunTrigger();
public abstract void StopTrigger();
}
Then I created a more specific script:
public class GasScript : TriggeredScript
{
// Use this for initialization
public Rect area;
void Start ()
{
}
...
}
Then I have a game object with a script on it:
public class Switch : MonoBehaviour
{
public DoorTrigger[] doorTriggers;
public TriggeredScript[] eventTriggers;
public bool sticky;
...
}
in the editor it has TriggeredScript which my GasScript extends, why can it not add it in the editor to the field?
(yes its an array and i have the size as one showing one slot but cannot drag the script over)
is this kind of encapsulation just not handled by unity especially in the editor ?? or fingers crossed am I just doing something dumb and missing to add or do something else.
edit FIGURED IT OUT! I will answer my own question for posterity, but it seems I had to drop the GasScript on a Gameobject, and set the array that has triggered script
to the gameobject with the script. Why this seemed different this time I don’t know, in fact it is always like that?! Oh well, fixed!
if i can find the delete I might do that cause this was just me being dumb.