Files
valheim/Assets/AI/AIController.cs

415 lines
14 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using DG.Tweening;
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;
using Valheim;
public class AIController : MonoBehaviour
{
public AudioClip introAudio;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public string waveAnimationTrigger = "Wave";//<2F><><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public string leaveAnimationTrigger = "Leave";//<2F><EFBFBD><EBBFAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><>ת<EFBFBD><D7AA><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>
public float rotationDuration = 1.5f;//<2F><>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
public float spawnDistance = 2f;//<2F><><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>
public float rotationSmoothness = 5f;//<2F><>תƽ<D7AA><C6BD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
public float charDisplayDelay = 0.5f;//ÿ<><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ӳ<EFBFBD>ʱ<EFBFBD><CAB1>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
public event Action OnIntroductionComplete;
private AudioSource audioSource;
private Animator animator;
private bool isIntroductionStarted = false;
private Transform playerTransform;
private Coroutine introductionCoroutine;
private Coroutine textDisplayCoroutine;
private bool hasIntroductionCompleted = false;//<2F><><EFBFBD>ӱ<EFBFBD>־λ
private bool isDuringIntroduction = false;//<2F><><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD>ڼ<EFBFBD>
//<2F>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>
public TMP_Text speedTxt;
private const float TxtSpeed = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾʱ<CABE><CAB1>
public Image dialogBoxImage;//<2F>Ի<EFBFBD><D4BB><EFBFBD>ͼ<EFBFBD><CDBC>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>Ƕ<EFBFBD>
private Quaternion specialRotationOffset;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תƫת
private void Awake()
{
audioSource= GetComponent<AudioSource>();
if(audioSource == null)
{
audioSource = gameObject.AddComponent<AudioSource>();
}
animator = GetComponent<Animator>();
//<2F>޸ģ<DEB8><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תƫ<D7AA><C6AB>
specialRotationOffset = Quaternion.Euler(0, 90, 0);
}
private void Start()
{
FindPlayer();
//<2F><>ʼʱ<CABC><CAB1><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
if (speedTxt != null)
{
speedTxt.gameObject.SetActive(false);
}
//<2F><>ʼʱ<CABC><CAB1><EFBFBD>ضԻ<D8B6><D4BB><EFBFBD>
if (dialogBoxImage != null)
{
dialogBoxImage.gameObject.SetActive(false);
}
}
private void Update()
{
//<2F>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD>ڼ<EFBFBD>ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (isDuringIntroduction && playerTransform != null)
{
FacePlayerWithOffset();
}
}
//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>Player
private void FindPlayer()
{
//ͨ<><CDA8>GameManager<65><72>ȡPlayer
if (GameManager.Ins != null && GameManager.Ins.player != null)
{
playerTransform = GameManager.Ins.player.transform;
Debug.Log("<22><>GameManager<65><72><EFBFBD>ҵ<EFBFBD>Player");
return;
}
//ͨ<><CDA8><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>Player
GameObject playerObj = GameObject.FindGameObjectWithTag("Player");
if (playerObj != null)
{
playerTransform = playerObj.transform;
Debug.Log("<22>ҵ<EFBFBD>Player<65><72>ǩ");
return;
}
//ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Player<65><72><EFBFBD>
Player playerController = FindObjectOfType<Player>();
if (playerController != null)
{
playerTransform = playerController.transform;
Debug.Log("<22>ҵ<EFBFBD>player<65><72><EFBFBD>");
return;
}
Debug.LogError("Playerû<72><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
StartCoroutine(RetryFindPlayer());
}
private IEnumerator RetryFindPlayer()
{
yield return new WaitForSeconds(1f);
FindPlayer();
}
public void StartIntroduction()
{
if (isIntroductionStarted) return;
//ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Player<65><72><EFBFBD><EFBFBD>
if(playerTransform == null)
{
FindPlayer();
if (playerTransform == null)
{
Debug.LogError("<22><><EFBFBD>ܿ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>Ҳο<D2B2><CEBF>ǿյ<C7BF>");
return;
}
}
isIntroductionStarted = true;
Debug.Log("AI<41><49><EFBFBD>ܿ<EFBFBD>ʼ");
//ֹͣ<CDA3>κ<EFBFBD><CEBA><EFBFBD><EFBFBD>е<EFBFBD>Э<EFBFBD><D0AD>
if (introductionCoroutine != null)
{
StopCoroutine(introductionCoroutine);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><D0AD>
introductionCoroutine = StartCoroutine(IntroductionRoutine());
}
private IEnumerator IntroductionRoutine()
{
Debug.Log("<22><>ʼ<EFBFBD><CABC><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD>");
isDuringIntroduction = true;
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FacePlayerWithOffset();
//Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת
if (playerTransform != null)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵķ<D2B5><C4B7><EFBFBD>
Vector3 directionToPlayer = playerTransform.position - transform.position;
directionToPlayer.y = 0;//<2F><><EFBFBD><EFBFBD>ˮƽ<CBAE><C6BD><EFBFBD><EFBFBD>
if (directionToPlayer != Vector3.zero)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Quaternion lookAtPlayer = Quaternion.LookRotation(directionToPlayer);
//Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תƫ<D7AA><C6AB>
Quaternion targetRotation = lookAtPlayer * specialRotationOffset;
//ƽ<><C6BD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ŀ<EFBFBD><C4BF>Ƕ<EFBFBD>
yield return StartCoroutine(SmoothRotate(targetRotation, rotationDuration));
}
}
//<2F><><EFBFBD>Ŵ<EFBFBD><C5B4>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD>
if (animator != null && !string.IsNullOrEmpty(waveAnimationTrigger))
{
animator.SetTrigger(waveAnimationTrigger);
Debug.Log("<22><><EFBFBD>Ŵ<EFBFBD><C5B4>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD>");
//ͬʱ<CDAC><CAB1><EFBFBD>ſ<EFBFBD><C5BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ
if (introAudio != null)
{
//ֻ<>ڴ<EFBFBD><DAB4>к<EFBFBD><D0BA><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>ı<EFBFBD>
if (speedTxt != null)
{
speedTxt.gameObject.SetActive(true);
string fullText = "欢迎来到魔力队长的幻宠世界,空间站里涌来了大量的怪物,你需要幻宠协助你清理这些怪物,选择属于自己实力强大的幻宠一起战斗吧,我们的安全就拜托你了。";
textDisplayCoroutine = StartCoroutine(DisplayTextCharByChar(fullText));
//<2F>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD>ֿ<EFBFBD>ʼ<EFBFBD><CABC>ʾ<EFBFBD><CABE><EFBFBD>ٲ<EFBFBD><D9B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
yield return new WaitForSeconds(0.5f);
}
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ţ<EFBFBD>" + introAudio.name);
audioSource.clip = introAudio;
audioSource.Play();
//<2F>ȴ<EFBFBD><C8B4><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD>ڽ<EFBFBD><DABD><EFBFBD>ǰ2<C7B0><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
float audioLength = introAudio.length;
yield return new WaitForSeconds(audioLength - 2f);//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
//<2F><>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
if (speedTxt != null)
{
HideTxt();
}
//<2F>ȴ<EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
yield return new WaitForSeconds(2f);
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>");
}
else
{
//<2F><><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ȴ<EFBFBD>12<31><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
yield return new WaitForSeconds(10f);//<2F><><EFBFBD>ٵȴ<D9B5>ʱ<EFBFBD><EFBFBD><E4A3AC>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>Ҫ<EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>Ƶ
if (speedTxt != null)
{
HideTxt();
}
yield return new WaitForSeconds(2f);//<2F>ٵȴ<D9B5><C8B4><EFBFBD><EFBFBD><EFBFBD>
}
}
else
{
Debug.LogError("AI<41><49><EFBFBD><EFBFBD>û<EFBFBD>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD>Ƶ");
yield return new WaitForSeconds(3f);
}
//<2F><><EFBFBD>ܽ<EFBFBD><DCBD><EFBFBD><EFBFBD><EFBFBD>ֹͣʵʱ<CAB5><CAB1><EFBFBD><EFBFBD>
isDuringIntroduction = false;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBBFAA><EFBFBD><EFBFBD>
if (animator != null && !string.IsNullOrEmpty(leaveAnimationTrigger))
{
//<2F>ȴ<EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD><CAB1>󲥷<EFBFBD><F3B2A5B7><EFBFBD><EBBFAA><EFBFBD><EFBFBD>
yield return new WaitForSeconds(2f);
//<2F><>ת180<38><30>
Quaternion targetRotation = transform.rotation * Quaternion.Euler(0, 180, 0);
yield return StartCoroutine(SmoothRotate(targetRotation, rotationDuration));
animator.SetTrigger(leaveAnimationTrigger);
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBBFAA><EFBFBD><EFBFBD>");
//<2F>ȴ<EFBFBD><C8B4><EFBFBD><EBBFAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
yield return new WaitForSeconds(2f);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
hasIntroductionCompleted = true;
OnIntroductionComplete?.Invoke();
Debug.Log("AI<41><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD>뿪");
//<2F><><EFBFBD><EFBFBD>AI<41><49>ɫ
gameObject.SetActive(false);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>Э<EFBFBD><D0AD>
private IEnumerator DisplayTextCharByChar(string fullText)
{
if (speedTxt == null) yield break;
//<2F><><EFBFBD><EFBFBD><EEB2A2>ʾ<EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>
if (dialogBoxImage != null)
{
dialogBoxImage.gameObject.SetActive(true);
//<2F><><EFBFBD>öԻ<C3B6><D4BB><EFBFBD><EFBFBD>ʼ͸<CABC><CDB8><EFBFBD><EFBFBD>Ϊ0
dialogBoxImage.color = new Color(dialogBoxImage.color.r, dialogBoxImage.color.g, dialogBoxImage.color.b, 0f);
//<2F>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>
dialogBoxImage.DOFade(1f, TxtSpeed).SetEase(Ease.Linear);
}
//<2F><>ʼʱ<CABC><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>͸<EFBFBD><CDB8><EFBFBD><EFBFBD>Ϊ0<CEAA><30><EFBFBD><EFBFBD>ȫ͸<C8AB><CDB8><EFBFBD><EFBFBD>
speedTxt.color = new Color(speedTxt.color.r, speedTxt.color.g, speedTxt.color.b, 0f);
//<2F>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>
speedTxt.DOFade(1f, TxtSpeed).SetEase(Ease.Linear);
yield return new WaitForSeconds(TxtSpeed);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ı<EFBFBD>
speedTxt.text = "";//<2F><><EFBFBD><EFBFBD>ı<EFBFBD>
for(int i = 0; i < fullText.Length; i++)
{
speedTxt.text += fullText[i];
yield return new WaitForSeconds(charDisplayDelay);
}
}
//ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
private void FacePlayerWithOffset()
{
if (playerTransform == null) return;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵķ<D2B5><C4B7><EFBFBD>
Vector3 directionToPlayer = playerTransform.position - transform.position;
directionToPlayer.y = 0;//<2F><><EFBFBD><EFBFBD>ˮƽ<CBAE><C6BD><EFBFBD><EFBFBD>
if (directionToPlayer != Vector3.zero)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ת
Quaternion lookRotation = Quaternion.LookRotation(directionToPlayer);
//Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תƫ<D7AA><C6AB>
Quaternion targetRotation = lookRotation * specialRotationOffset;
//ƽ<><C6BD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ŀ<EFBFBD><C4BF>Ƕ<EFBFBD>
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * rotationSmoothness);
}
}
//ƽ<><C6BD><EFBFBD><EFBFBD>תЭ<D7AA><D0AD>
private IEnumerator SmoothRotate(Quaternion targetRotation,float duration)
{
float elapsedTime = 0f;
Quaternion startRotation = transform.rotation;
while (elapsedTime < duration)
{
transform.rotation = Quaternion.Slerp(startRotation, targetRotation, elapsedTime / duration);
elapsedTime += Time.deltaTime;
yield return null;
}
//ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ŀ<EFBFBD><C4BF>Ƕ<EFBFBD>
transform.rotation = targetRotation;
}
public void StartTxt(string txt, Action cb = null)
{
if (speedTxt == null) return;
speedTxt.text = txt;
//<2F><>ʼʱ<CABC><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>͸<EFBFBD><CDB8><EFBFBD><EFBFBD>Ϊ0<CEAA><30><EFBFBD><EFBFBD>ȫ͸<C8AB><CDB8><EFBFBD><EFBFBD>
speedTxt.color = new Color(speedTxt.color.r, speedTxt.color.g, speedTxt.color.b, 0f);
// ʹ<><CAB9>DoTweenʵ<6E><CAB5><EFBFBD><EFBFBD><EFBFBD>ֵĽ<D6B5><C4BD><EFBFBD>Ч<EFBFBD><D0A7>
speedTxt.DOFade(1f, TxtSpeed).SetEase(Ease.Linear).OnComplete(() =>
{
cb?.Invoke();
}); // <20><><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD>ȫ<EFBFBD><C8AB>͸<EFBFBD><CDB8><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>Ч<EFBFBD><D0A7>
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1>ķ<EFBFBD><C4B7><EFBFBD>
public void HideTxt(Action cb = null)
{
if (speedTxt == null) return;
//ֹͣ<CDA3>κ<EFBFBD><CEBA><EFBFBD><EFBFBD>ڽ<EFBFBD><DABD>е<EFBFBD><D0B5>ı<EFBFBD><C4B1><EFBFBD>ʾЭ<CABE><D0AD>
if (textDisplayCoroutine != null)
{
StopCoroutine(textDisplayCoroutine);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1>ͶԻ<CDB6><D4BB><EFBFBD>
Sequence hideSequence = DOTween.Sequence();
//<2F><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (speedTxt != null)
{
hideSequence.Join(speedTxt.DOFade(0f, TxtSpeed).SetEase(Ease.Linear));
}
//<2F><><EFBFBD>ӶԻ<D3B6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (dialogBoxImage != null)
{
hideSequence.Join(dialogBoxImage.DOFade(0f, TxtSpeed).SetEase(Ease.Linear));
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>󲢵<EFBFBD><F3B2A2B5>ûص<C3BB>
hideSequence.OnComplete(() =>
{
if (speedTxt != null)
{
speedTxt.gameObject.SetActive(false);
}
if (dialogBoxImage != null)
{
dialogBoxImage.gameObject.SetActive(false);
}
cb?.Invoke();
});
}
private void OnDestroy()
{
//<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD>
if (introductionCoroutine != null)
{
StopCoroutine(introductionCoroutine);
}
if(textDisplayCoroutine != null)
{
StopCoroutine(textDisplayCoroutine);
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tween<65><6E><EFBFBD><EFBFBD>
if (speedTxt != null)
{
speedTxt.DOKill();
}
if (dialogBoxImage != null)
{
dialogBoxImage.DOKill();
}
}
}