- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
73 lines
1.9 KiB
C#
73 lines
1.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 继承Mono的同步处理抽象类
|
|
/// </summary>
|
|
public abstract class AbsSyncHandler : MonoBehaviour, ISyncHand
|
|
{
|
|
protected string soleName;
|
|
float interval;//帧同步数据正常情况下应该进入的时间间隔
|
|
bool lerpTrans;//是否开启lerp同步
|
|
bool lerping = false;//当前数据是否需要执行Lerp
|
|
float lerpTimer;//开启Lerp时的计时器 用于计算每帧的位置
|
|
// Start is called before the first frame update
|
|
protected virtual void Awake()
|
|
{
|
|
soleName = this.gameObject.name;
|
|
}
|
|
|
|
public void ExitHandList()
|
|
{
|
|
SyncGOManager.Instance.RemoHandler(this);
|
|
}
|
|
|
|
public string GetSoleName()
|
|
{
|
|
return soleName;
|
|
}
|
|
|
|
public abstract void HandleSyncData(object msg, string msgType = null);
|
|
|
|
|
|
public virtual void InitInterval(float time)
|
|
{
|
|
interval = time;
|
|
if (interval > 0.04f)
|
|
lerpTrans = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 加入消息分发队列 开始接收同步消息 由子类确定调用时机
|
|
/// </summary>
|
|
public void JoinHandList()
|
|
{
|
|
SyncGOManager.Instance.AddHandler(this);
|
|
}
|
|
|
|
protected virtual void FixedUpdate()
|
|
{
|
|
if (lerpTrans && lerping)
|
|
{
|
|
if (lerpTimer <= interval)
|
|
{
|
|
lerpTimer += Time.fixedUnscaledDeltaTime;
|
|
LerpSyncData(lerpTimer / interval);
|
|
}
|
|
else//Lerp完成了
|
|
{
|
|
lerping = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
//Lerp同步位置
|
|
protected virtual void LerpSyncData(float progress)
|
|
{
|
|
//LerpOneTrans(headTrans, currentHead, personSyncData.head, progress);
|
|
//LerpOneTrans(leftHandTrans, currentLH, personSyncData.LH, progress);
|
|
//LerpOneTrans(rightHandTrans, currentRH, personSyncData.RH, progress);
|
|
}
|
|
}
|