This commit is contained in:
parent
7c296885b4
commit
6e3ba07fe0
|
@ -9,8 +9,6 @@ public class UI_CustomSessionPanel : BasePanel
|
|||
{
|
||||
private string triggerID;
|
||||
public Action<string> callBack;
|
||||
private TextMeshProUGUI UItext;
|
||||
private string fullText;
|
||||
private float typingSpeed = 0.05f;
|
||||
|
||||
/// <summary>
|
||||
|
@ -20,9 +18,9 @@ public class UI_CustomSessionPanel : BasePanel
|
|||
{
|
||||
this.triggerID = triggerID;
|
||||
callBack += _callBack;
|
||||
GetControl<TextMeshProUGUI>("ClientText_DialogBox").text = clientTalk /*"好的"*/;
|
||||
UItext = GetControl<TextMeshProUGUI>("ClientText_DialogBox");
|
||||
StartTypewriterEffect();
|
||||
//GetControl<TextMeshProUGUI>("ClientText_DialogBox").text = clientTalk /*"好的"*/;
|
||||
//UItext = GetControl<TextMeshProUGUI>("ClientText_DialogBox");
|
||||
StartTypewriterEffect(clientTalk);
|
||||
}
|
||||
|
||||
//}
|
||||
|
@ -40,10 +38,10 @@ public class UI_CustomSessionPanel : BasePanel
|
|||
break;
|
||||
}
|
||||
}
|
||||
void StartTypewriterEffect()
|
||||
void StartTypewriterEffect(string msg)
|
||||
{
|
||||
// 使用DoTween的DOText方法实现打字机效果
|
||||
UItext.DOText(fullText, fullText.Length * typingSpeed)
|
||||
GetControl<TextMeshProUGUI>("ClientText_DialogBox").DOText(msg, msg.Length * typingSpeed)
|
||||
.SetEase(Ease.Linear);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,6 @@ public class UI_PlayerSessionPanel : BasePanel
|
|||
{
|
||||
private string triggerID;
|
||||
public Action<string> callBack;
|
||||
private TextMeshProUGUI UItext;
|
||||
private string fullText;
|
||||
private float typingSpeed = 0.05f;
|
||||
/// <summary>
|
||||
/// 初始化,state 0 激活另一个操作
|
||||
|
@ -20,9 +18,9 @@ public class UI_PlayerSessionPanel : BasePanel
|
|||
{
|
||||
this.triggerID = triggerID;
|
||||
callBack += _callBack;
|
||||
GetControl<TextMeshProUGUI>("PlayerText_DialogBox").text = clientTalk /*"ºÃµÄ"*/;
|
||||
UItext = GetControl<TextMeshProUGUI>("PlayerText_DialogBox");
|
||||
StartTypewriterEffect();
|
||||
//GetControl<TextMeshProUGUI>("PlayerText_DialogBox").text = clientTalk /*"ºÃµÄ"*/;
|
||||
//UItext = GetControl<TextMeshProUGUI>("PlayerText_DialogBox");
|
||||
StartTypewriterEffect(clientTalk);
|
||||
}
|
||||
|
||||
//}
|
||||
|
@ -40,10 +38,10 @@ public class UI_PlayerSessionPanel : BasePanel
|
|||
break;
|
||||
}
|
||||
}
|
||||
void StartTypewriterEffect()
|
||||
void StartTypewriterEffect(string msg)
|
||||
{
|
||||
// 使用DoTween的DOText方法实现打字机效果
|
||||
UItext.DOText(fullText, fullText.Length * typingSpeed)
|
||||
GetControl<TextMeshProUGUI>("PlayerText_DialogBox").DOText(msg, msg.Length * typingSpeed)
|
||||
.SetEase(Ease.Linear);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue