public void CreateHeadingPopup3D(string text, string subHeading, Vector3 location, float scale, float extraLife = 2.0f) { PopupText3D heading = CreatePopup3D(text, location, scale, Color.white, FontStyle.BoldAndItalic); PopupText3D subheading = CreatePopup3D(subHeading, location, scale * 0.5f, Color.grey, FontStyle.Italic); subheading.transform.position += Vector3.down * scale * 0.15f; heading.ExtendLifetime(extraLife); subheading.ExtendLifetime(extraLife); }
public PopupText3D Spawn(string text, Vector3 location, float fontScale, Color colour, FontStyle style) { PopupText3D popup = Instantiate(this, location, Quaternion.identity); popup.gameObject.SetActive(true); popup.m_PrimaryText.text = text; popup.m_ShadowText.text = text; popup.m_PrimaryText.fontSize = Mathf.CeilToInt(popup.m_PrimaryText.fontSize * fontScale); popup.m_ShadowText.fontSize = Mathf.CeilToInt(popup.m_ShadowText.fontSize * fontScale); popup.m_PrimaryText.color = colour; popup.m_PrimaryText.fontStyle = style; popup.m_ShadowText.fontStyle = style; return(popup); }