unityzgy/.svn/pristine/e6/e6bebe569ccbc94815b9244815ceae3b0027a7ac.svn-base
ayuan9957 bf12e02276 feat: 多语言本地化系统 - 支持中/英/法/俄实时切换
- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg)
- LoginPanel: InputField placeholder本地化、字体颜色保持
- HistoryPanel: 用时数据本地化、placeholder本地化
- RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建)
- AppraiseWindowBase: 评价等级本地化、操作消息重建
- EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized
- StudentOperateRecorder: 新增InjectOperateMsgLocalized方法
- LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选
- 字体切换时保留颜色和verticalOverflow
2026-07-16 10:05:59 +08:00

43 lines
2.1 KiB
Plaintext

// Rotator Track Grab Attach|GrabAttachMechanics|50090
namespace VRTK.GrabAttachMechanics
{
using UnityEngine;
/// <summary>
/// The Rotator Track Grab Attach script is used to track the object but instead of the object tracking the direction of the controller, a force is applied to the object to cause it to rotate.
/// </summary>
/// <remarks>
/// This is ideal for hinged joints on items such as wheels or doors.
/// </remarks>
/// <example>
/// `VRTK/Examples/021_Controller_GrabbingObjectsWithJoints` demonstrates this grab attach mechanic on the Wheel and Door objects in the scene.
/// </example>
[AddComponentMenu("VRTK/Scripts/Interactions/Grab Attach Mechanics/VRTK_RotatorTrackGrabAttach")]
public class VRTK_RotatorTrackGrabAttach : VRTK_TrackObjectGrabAttach
{
/// <summary>
/// The StopGrab method ends the grab of the current object and cleans up the state.
/// </summary>
/// <param name="applyGrabbingObjectVelocity">If true will apply the current velocity of the grabbing object to the grabbed object on release.</param>
public override void StopGrab(bool applyGrabbingObjectVelocity)
{
isReleasable = false;
base.StopGrab(applyGrabbingObjectVelocity);
}
/// <summary>
/// The ProcessFixedUpdate method is run in every FixedUpdate method on the interactable object. It applies a force to the grabbed object to move it in the direction of the grabbing object.
/// </summary>
public override void ProcessFixedUpdate()
{
var rotateForce = trackPoint.position - initialAttachPoint.position;
grabbedObjectRigidBody.AddForceAtPosition(rotateForce, initialAttachPoint.position, ForceMode.VelocityChange);
}
protected override void SetTrackPointOrientation(ref Transform trackPoint, Transform currentGrabbedObject, Transform controllerPoint)
{
trackPoint.position = controllerPoint.position;
trackPoint.rotation = controllerPoint.rotation;
}
}
}