- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
namespace VRTK.Examples
|
|
{
|
|
using UnityEngine;
|
|
using VRTK;
|
|
|
|
public class UseRotate : VRTK_InteractableObject
|
|
{
|
|
[Header("Rotation when in use")]
|
|
[SerializeField]
|
|
[Tooltip("Rotation speed when not in use (deg/sec)")]
|
|
private float idleSpinSpeed = 0f;
|
|
[SerializeField]
|
|
[Tooltip("Rotation speed when in use (deg/sec)")]
|
|
private float activeSpinSpeed = 360f;
|
|
[Tooltip("Game object to rotate\n(leave empty to use this object)")]
|
|
[SerializeField]
|
|
private Transform rotatingObject;
|
|
[SerializeField]
|
|
private Vector3 rotationAxis = Vector3.up;
|
|
|
|
private float spinSpeed = 0f;
|
|
|
|
public override void StartUsing(VRTK_InteractUse usingObject)
|
|
{
|
|
base.StartUsing(usingObject);
|
|
spinSpeed = activeSpinSpeed;
|
|
}
|
|
|
|
public override void StopUsing(VRTK_InteractUse usingObject)
|
|
{
|
|
base.StopUsing(usingObject);
|
|
spinSpeed = idleSpinSpeed;
|
|
}
|
|
|
|
protected void Start()
|
|
{
|
|
if (rotatingObject == null)
|
|
{
|
|
rotatingObject = transform;
|
|
}
|
|
spinSpeed = idleSpinSpeed;
|
|
}
|
|
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
rotatingObject.Rotate(rotationAxis, spinSpeed * Time.deltaTime);
|
|
}
|
|
}
|
|
} |