void Awake() { anim = GetComponent <Animation>(); foreach (GameObject go in contents) { HandWriting handWritting = go.AddComponent(typeof(HandWriting)) as HandWriting; handWritting.Init(go.GetComponentInChildren <Text>().text); } }
void Awake() { mainSection = GetComponentInParent <MainSection>(); handWritting = gameObject.AddComponent(typeof(HandWriting)) as HandWriting; handWritting.Init(field.text); }