- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
69 lines
1.8 KiB
C#
69 lines
1.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class MoveBlock : MonoBehaviour
|
|
{
|
|
public float moveYAmount = 20.0f;
|
|
public float moveSpeed = 1.0f;
|
|
public float waitTime = 5.0f;
|
|
public float rotateSpeed = 10.0f;
|
|
|
|
private float startY;
|
|
private bool goingUp = true;
|
|
private float stoppedUntilTime;
|
|
private float moveUpAmount;
|
|
|
|
protected virtual void Start ()
|
|
{
|
|
startY = transform.position.y;
|
|
|
|
moveUpAmount = Mathf.Abs(moveYAmount);
|
|
|
|
if(moveYAmount < 0.0f)
|
|
{
|
|
startY -= moveYAmount;
|
|
goingUp = false;
|
|
}
|
|
|
|
stoppedUntilTime = Time.time + waitTime;
|
|
}
|
|
|
|
protected virtual void Update ()
|
|
{
|
|
if( Time.time > stoppedUntilTime)
|
|
{
|
|
if(goingUp)
|
|
{
|
|
if(transform.position.y < startY+moveUpAmount)
|
|
{
|
|
Vector3 newPosition = transform.position;
|
|
newPosition.y += Time.deltaTime * moveSpeed;
|
|
transform.position = newPosition;
|
|
}
|
|
else
|
|
{
|
|
goingUp = false;
|
|
stoppedUntilTime = Time.time + waitTime;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(transform.position.y > startY)
|
|
{
|
|
Vector3 newPosition = transform.position;
|
|
newPosition.y -= Time.deltaTime * moveSpeed;
|
|
transform.position = newPosition;
|
|
}
|
|
else
|
|
{
|
|
goingUp = true;
|
|
stoppedUntilTime = Time.time + waitTime;
|
|
}
|
|
}
|
|
}
|
|
|
|
transform.Rotate(new Vector3(0.0f, rotateSpeed * Time.deltaTime, 0.0f));
|
|
}
|
|
}
|