/// <summary> /// 指定された場所に指定された設定で3Dのメッセージを表示する /// </summary> public void ShowMessage3D(string message, Vector3 position, Quaternion rotation, Transform parent, FontSettings settings) { AbstractTextMesh text = textMeshPool.GetInstance(); InitializeTextMesh(text, message, settings); text.transform.SetParent(parent); text.transform.SetPositionAndRotation(position, rotation); StartCoroutine(settings.showAnimation.GetAnimation(text, settings.showAnimationTime).OnCompleted(() => { if (settings.limitLife <= 0.0f) { StartCoroutine(settings.hideAnimation.GetAnimation(text, settings.hideAnimationTime).OnCompleted(() => { textMeshPool.ReturnInstance(text); })); } else { KKUtilities.Delay(settings.limitLife, () => { StartCoroutine(settings.hideAnimation.GetAnimation(text, settings.hideAnimationTime).OnCompleted(() => { textMeshPool.ReturnInstance(text); })); }, this); } })); }
void InitializeTextMesh(AbstractTextMesh text, string message, FontSettings settings) { InitializeUIText(text, message, settings); text.transform.localScale = Vector3.one; text.gameObject.SetActive(true); }