public virtual void Show(NarrationFragment fragment) { Show(true); if (TweenText != null) { TweenText.Complete(); } if (TweenAlpha != null) { TweenAlpha.Kill(); } if (fragment.IsNewPage) { DescPool.DespawnAll(); } GameObject tempGO = DescPool.Spawn(); CurDesc = tempGO.GetComponent <UText>(); CurDesc.RichName.text = ""; CurDesc.IsAnimation = false; CurDesc.Show(true); CurDesc.transform.SetAsLastSibling(); CurDesc.Name.CrossFadeAlpha(0, 0f, true); Title.NameText = fragment.GetName(); if (fragment.IsNewPage) { CurDesc.RichName.Content = ""; CanvasGroup.alpha = 0.0f; TweenAlpha = DOTween.To(() => CanvasGroup.alpha, (x) => CanvasGroup.alpha = x, 1.0f, 0.3f); CurDesc.Name.CrossFadeAlpha(1, 0.5f, true); } else { string temp = fragment.GetDesc(); CurDesc.Name.CrossFadeAlpha(1, 0.5f, true); } CurDesc.RichName.Content = fragment.GetDesc(); CurDesc.RichName.RefreshRichText(); Sprite preSprite = Image.Icon.sprite; Sprite newSprite = fragment.GetIcon(); if (newSprite != null) { Image.Icon.sprite = newSprite; } Title.Show(fragment.CurPage == 0); Image.Show(true); }
void OnNextNarration(TDBaseNarrationData narration, NarrationFragment fragment, int index) { Show(fragment); }
void OnEndNarration(TDBaseNarrationData narration, NarrationFragment fragment) { Show(false); BGMMgr.Revert(); }
void OnStartNarration(TDBaseNarrationData narration, NarrationFragment fragment) { Show(fragment); BGMMgr.StartBGM(narration.Music); }