Using 5.1.1f1
I’m trying to write a system that will allow me to hear dialog in edit mode without having to walk to the area the dialog is in every time I want to test timing. After some research, I figured an Update function might help with getting delays to work. I’m starting with something basic to see if this will even work, but for some reason, it seems like Update isn’t called at all, or at least I can’t tell if it’s called.
#pragma strict
@CustomEditor (Dialogue)
public class DialogueEditor extends Editor
{
var delay : float;
var testActive = true;
function OnInspectorGUI()
{
DrawDefaultInspector();
var script : Dialogue = target;
if(GUILayout.Button("Test Dialogue"))
{
testActive = true;
}
}
function Update()
{
var script : Dialogue = target;
if (testActive)
{
delay += 0.01;
if(delay % 1 == 0) Debug.Log("Woof");
if(delay == 10)
{
delay = 0;
testActive = false;
}
}
}
}