// Use this for initialization void OnEnable() { m_partyUI = GetComponentInParent <PartyUI>(); m_text = GetComponent <Text>(); string stringToWrite = m_partyUI.WhatToWrite(); int stringLength = stringToWrite.Length; m_text.fontSize = 12; if (stringLength > 30) { m_text.fontSize = 10; } m_text.text = stringToWrite; m_text.color = m_partyUI.GetCurrentColor(); }