public override void ComponentAwake() { // Grab a reference to the text writer, which we hook into and check if its typing textWriter = GetRequiredComponentInParent <TextWriterComponent>(); animator = GetRequiredComponent <Animator>(); base.ComponentAwake(); }
private void InstantiateNext() { string message = texts.Pop(); textWriterObject = InstantiatePrefab(textWriterPrefab, FindOrCreateCanvas().transform); textWriterObject.transform.localPosition = new Vector3(0, -80, 0); TextWriterComponent textWriter = GetRequiredComponent <TextWriterComponent>(textWriterObject); textWriter.LoadText(message); textWriterObject.SetActive(true); }