IEnumerator Scenes() { yield return(new WaitForSeconds(1f)); Am_Text text = new Am_Text("Hello world"); this.FadeIn(text, 0.5f); }
public static void FadeIn(this AmtionScene scene, Am_Text text, float duration) { if (text.gameObject == null || text.TextComponent == null) { scene.Add(text); } Color Trans = new Color(text.TextComponent.color.r, text.TextComponent.color.g, text.TextComponent.color.b, 0); Color Final = new Color(text.TextComponent.color.r, text.TextComponent.color.g, text.TextComponent.color.b, text.TextComponent.color.a); text.TextComponent.color = Trans; text.TextComponent.DOColor(Final, duration); }
public void Add(Am_Text Text) { if (Text.gameObject == null) { Text.gameObject = new GameObject(Text.DisplayText); Text.TextComponent = Text.gameObject.AddComponent <TextMeshPro>(); Text.Initialize(); } if (Text.TextComponent == null) { Text.TextComponent = Text.gameObject.AddComponent <TextMeshPro>(); Text.Initialize(); } }