- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
namespace EnviroSamples
|
|
{
|
|
public class FPSController : MonoBehaviour {
|
|
|
|
public float speed = 2f;
|
|
public float sensitivity = 2f;
|
|
CharacterController player;
|
|
|
|
public GameObject eyes;
|
|
|
|
float moveFB;
|
|
float moveLR;
|
|
|
|
float rotX;
|
|
float rotY;
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
|
|
player = GetComponent<CharacterController> ();
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
|
|
moveFB = Input.GetAxis ("Vertical") * speed;
|
|
moveLR = Input.GetAxis ("Horizontal") * speed;
|
|
|
|
rotX = Input.GetAxis ("Mouse X") * sensitivity;
|
|
rotY -= Input.GetAxis ("Mouse Y") * sensitivity;
|
|
|
|
rotY = Mathf.Clamp (rotY, -60f, 60f);
|
|
|
|
Vector3 movement = new Vector3 (moveLR, 0, moveFB);
|
|
transform.Rotate (0, rotX, 0);
|
|
eyes.transform.localRotation = Quaternion.Euler(rotY, 0, 0);
|
|
//eyes.transform.Rotate (-rotY, 0, 0);
|
|
|
|
movement = transform.rotation * movement;
|
|
movement.y -= 4000f * Time.deltaTime;
|
|
player.Move (movement * Time.deltaTime);
|
|
|
|
}
|
|
}
|
|
} |