UPDATE: if i add
EventDelegate.Add (main_label_obj.GetComponent<TypewriterEffect> ().onFinished, function_test);
on my void Start on the original typewritereffect component it works, but after i remove it and add it a new one seems like i can't point on it, no idea why...
so this works:
void Start(){
EventDelegate.Add (main_label_obj.GetComponent<TypewriterEffect> ().onFinished, function_test);
main_label.text = "Benvenuto Giocatore";
}
but i need to do this and don't work:
Destroy (main_label_obj.GetComponent<TypewriterEffect> ());
main_label_obj.AddComponent<TypewriterEffect> ();
main_label_obj.GetComponent<TypewriterEffect> ().ResetToBeginning ();
EventDelegate.Add (main_label_obj.GetComponent<TypewriterEffect> ().onFinished, function_test);
why i can't point to the new component? : (