- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
79 lines
2.0 KiB
Plaintext
79 lines
2.0 KiB
Plaintext
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
|
|
//
|
|
// Purpose: Sends simple controller button events to UnityEvents
|
|
//
|
|
//=============================================================================
|
|
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
namespace Valve.VR.InteractionSystem
|
|
{
|
|
//-------------------------------------------------------------------------
|
|
[RequireComponent( typeof( Interactable ) )]
|
|
public class InteractableButtonEvents : MonoBehaviour
|
|
{
|
|
public UnityEvent onTriggerDown;
|
|
public UnityEvent onTriggerUp;
|
|
public UnityEvent onGripDown;
|
|
public UnityEvent onGripUp;
|
|
public UnityEvent onTouchpadDown;
|
|
public UnityEvent onTouchpadUp;
|
|
public UnityEvent onTouchpadTouch;
|
|
public UnityEvent onTouchpadRelease;
|
|
|
|
//-------------------------------------------------
|
|
void Update()
|
|
{
|
|
for ( int i = 0; i < Player.instance.handCount; i++ )
|
|
{
|
|
Hand hand = Player.instance.GetHand( i );
|
|
|
|
if ( hand.controller != null )
|
|
{
|
|
if ( hand.controller.GetPressDown( Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger ) )
|
|
{
|
|
onTriggerDown.Invoke();
|
|
}
|
|
|
|
if ( hand.controller.GetPressUp( Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger ) )
|
|
{
|
|
onTriggerUp.Invoke();
|
|
}
|
|
|
|
if ( hand.controller.GetPressDown( Valve.VR.EVRButtonId.k_EButton_Grip ) )
|
|
{
|
|
onGripDown.Invoke();
|
|
}
|
|
|
|
if ( hand.controller.GetPressUp( Valve.VR.EVRButtonId.k_EButton_Grip ) )
|
|
{
|
|
onGripUp.Invoke();
|
|
}
|
|
|
|
if ( hand.controller.GetPressDown( Valve.VR.EVRButtonId.k_EButton_SteamVR_Touchpad ) )
|
|
{
|
|
onTouchpadDown.Invoke();
|
|
}
|
|
|
|
if ( hand.controller.GetPressUp( Valve.VR.EVRButtonId.k_EButton_SteamVR_Touchpad ) )
|
|
{
|
|
onTouchpadUp.Invoke();
|
|
}
|
|
|
|
if ( hand.controller.GetTouchDown( Valve.VR.EVRButtonId.k_EButton_SteamVR_Touchpad ) )
|
|
{
|
|
onTouchpadTouch.Invoke();
|
|
}
|
|
|
|
if ( hand.controller.GetTouchUp( Valve.VR.EVRButtonId.k_EButton_SteamVR_Touchpad ) )
|
|
{
|
|
onTouchpadRelease.Invoke();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|