- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
62 lines
1.5 KiB
C#
62 lines
1.5 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
public class QuickRope2Helper
|
|
{
|
|
public static bool HasMoved(ref Vector3 prevPoint, Vector3 curPoint)
|
|
{
|
|
bool r = Vector3.Distance(curPoint, prevPoint) >= 0.01f;
|
|
|
|
if (r) prevPoint = curPoint;
|
|
|
|
return r;
|
|
}
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class QuickRopeSpline
|
|
{
|
|
public List<Vector3> Points;
|
|
|
|
public Vector3 Interpolate(float t)
|
|
{
|
|
if (Points.Count < 4)
|
|
return Vector3.zero;
|
|
|
|
int numSections = Points.Count - 3;
|
|
int currPt = Mathf.Min(Mathf.FloorToInt(t * (float)numSections), numSections - 1);
|
|
float u = t * (float)numSections - (float)currPt;
|
|
|
|
Vector3 a = Points[currPt];
|
|
Vector3 b = Points[currPt + 1];
|
|
Vector3 c = Points[currPt + 2];
|
|
Vector3 d = Points[currPt + 3];
|
|
|
|
return .5f * (
|
|
(-a + 3f * b - 3f * c + d) * (u * u * u)
|
|
+ (2f * a - 5f * b + 4f * c - d) * (u * u)
|
|
+ (-a + c) * u
|
|
+ 2f * b
|
|
);
|
|
}
|
|
|
|
public void DrawGizmo(float t, int precision, Color splineColor)
|
|
{
|
|
if (Points.Count < 3)
|
|
return;
|
|
|
|
Gizmos.color = splineColor;
|
|
Vector3 prevPt = Interpolate(0);
|
|
|
|
for (int i = 1; i <= 100; i++)
|
|
{
|
|
float pm = (float)i / (float)100;
|
|
Vector3 currPt = Interpolate(pm);
|
|
Gizmos.DrawLine(currPt, prevPt);
|
|
prevPt = currPt;
|
|
}
|
|
|
|
Gizmos.color = Color.white;
|
|
}
|
|
} |