- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
82 lines
2.3 KiB
Plaintext
82 lines
2.3 KiB
Plaintext
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using DG.Tweening;
|
|
using System;
|
|
|
|
public class SimplePipe : VRUsableStepActionBase
|
|
{
|
|
private BezierPipe pipeMesh;
|
|
|
|
[Tooltip("与该线路连接的接头是否为固定位置的")]
|
|
public bool connectorIsFixed;
|
|
|
|
//该线路插头插上时应保持的位置
|
|
public Vector3 thisFixedPos;
|
|
|
|
//该线路插头断开时保持的位置
|
|
public Vector3 thisFreePos;
|
|
|
|
[PropertyActive("connectorIsFixed", true, CompareType.Equl)]
|
|
public Transform connector;
|
|
[PropertyActive("connectorIsFixed", true, CompareType.Equl)]
|
|
public Vector3 connectorFixedPos;
|
|
[PropertyActive("connectorIsFixed", true, CompareType.Equl)]
|
|
public Vector3 connectorFreePos;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
if (thisFixedPos == Vector3.zero)//未设置安装位置时 按照初始位置作为安装位置
|
|
thisFixedPos = this.transform.localPosition;
|
|
if (connector)
|
|
{
|
|
connectorFixedPos = connector.transform.localPosition;
|
|
}
|
|
|
|
pipeMesh = this.transform.parent.GetComponentInChildren<BezierPipe>();
|
|
if (pipeMesh)
|
|
pipeMesh.update = false;//接头固定时不计算管路mesh 避免消耗性能
|
|
}
|
|
|
|
public override void OnUsed()
|
|
{
|
|
SetUsable(false);
|
|
if (pipeMesh)
|
|
pipeMesh.update = true;
|
|
if (processName == ProcessEnum.teardown)
|
|
{
|
|
this.transform.DOLocalMove(thisFreePos, 1f).OnComplete(UnFixedMoveOver);
|
|
if (!connectorIsFixed)
|
|
{
|
|
connector.DOLocalMove(connectorFreePos, 1f);
|
|
}
|
|
}
|
|
else if (processName == ProcessEnum.assemble)
|
|
{
|
|
this.transform.DOLocalMove(thisFixedPos, 1f).OnComplete(FixedMoveOver);
|
|
if (!connectorIsFixed)
|
|
{
|
|
connector.DOLocalMove(connectorFixedPos, 1f);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void FixedMoveOver()
|
|
{
|
|
if (pipeMesh)
|
|
pipeMesh.update = false;
|
|
fixedOver?.Invoke();
|
|
fixedOver = null;
|
|
}
|
|
|
|
private void UnFixedMoveOver()
|
|
{
|
|
if (pipeMesh)
|
|
pipeMesh.update = false;
|
|
unFixedOver?.Invoke();
|
|
unFixedOver = null;
|
|
}
|
|
|
|
}
|