- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
namespace VRTK.Examples
|
|
{
|
|
using UnityEngine;
|
|
|
|
public class Controller_Menu : MonoBehaviour
|
|
{
|
|
public GameObject menuObject;
|
|
|
|
private GameObject clonedMenuObject;
|
|
|
|
private bool menuInit = false;
|
|
private bool menuActive = false;
|
|
|
|
private void Start()
|
|
{
|
|
GetComponent<VRTK_ControllerEvents>().ButtonTwoPressed += new ControllerInteractionEventHandler(DoMenuOn);
|
|
GetComponent<VRTK_ControllerEvents>().ButtonTwoReleased += new ControllerInteractionEventHandler(DoMenuOff);
|
|
menuInit = false;
|
|
menuActive = false;
|
|
}
|
|
|
|
private void InitMenu()
|
|
{
|
|
clonedMenuObject = Instantiate(menuObject, transform.position, Quaternion.identity) as GameObject;
|
|
clonedMenuObject.SetActive(true);
|
|
menuInit = true;
|
|
}
|
|
|
|
private void DoMenuOn(object sender, ControllerInteractionEventArgs e)
|
|
{
|
|
if (!menuInit)
|
|
{
|
|
InitMenu();
|
|
}
|
|
if (clonedMenuObject != null)
|
|
{
|
|
clonedMenuObject.SetActive(true);
|
|
menuActive = true;
|
|
}
|
|
}
|
|
|
|
private void DoMenuOff(object sender, ControllerInteractionEventArgs e)
|
|
{
|
|
if (clonedMenuObject != null)
|
|
{
|
|
clonedMenuObject.SetActive(false);
|
|
menuActive = false;
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (clonedMenuObject != null && menuActive)
|
|
{
|
|
clonedMenuObject.transform.rotation = transform.rotation;
|
|
clonedMenuObject.transform.position = transform.position;
|
|
}
|
|
}
|
|
}
|
|
} |