Arnaud Carre
8 年前
当前提交
05fd006e
共有 16 个文件被更改,包括 1241 次插入 和 47 次删除
-
4Assets/BasicRenderBatching/BasicBatching.unity
-
2Assets/BasicRenderBatching/BasicRenderBatchingShader8.shader
-
6Assets/BasicRenderBatching/Scripts/MiniProfiler.cs
-
54Assets/BasicRenderBatching/Scripts/PopulateScene.cs
-
27Assets/TestScenes/HDTest/GlobalIlluminationTest.unity
-
32Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Green.mat
-
34Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Lit_Emissive_Blue.mat
-
32Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Red.mat
-
4ProjectSettings/EditorBuildSettings.asset
-
4ProjectSettings/GraphicsSettings.asset
-
50Assets/TestScenes/HDTest/FlyCamera.cs
-
12Assets/TestScenes/HDTest/FlyCamera.cs.meta
-
1001Assets/TestScenes/HDTest/GlobalIlluminationTest/LightingData.asset
-
8Assets/TestScenes/HDTest/GlobalIlluminationTest/LightingData.asset.meta
-
9Assets/TestScenes/HDTest/HDRI.meta
-
9Assets/TestScenes/HDTest/LayeredLitTest/Mesh/Materials.meta
|
|||
using System; |
|||
using UnityEngine; |
|||
|
|||
public class FlyCamera : MonoBehaviour |
|||
{ |
|||
public float LookSpeed = 2f; |
|||
public float MoveSpeed = 0.1f; |
|||
|
|||
protected float m_RotationX = 0f; |
|||
protected float m_RotationY = 0f; |
|||
|
|||
private bool m_Active = true; |
|||
|
|||
void Update() |
|||
{ |
|||
if (Input.GetMouseButtonDown(1)) |
|||
m_Active = !m_Active; |
|||
|
|||
if (!m_Active) |
|||
return; |
|||
|
|||
float joyX = 0f; |
|||
float joyY = 0f; |
|||
|
|||
try |
|||
{ |
|||
joyX = Input.GetAxis("Joystick Mouse X"); |
|||
joyY = Input.GetAxis("Joystick Mouse Y"); |
|||
} |
|||
catch |
|||
{ |
|||
// ignored
|
|||
} |
|||
|
|||
float mx = Input.GetAxis("Mouse X") + joyX; |
|||
float my = Input.GetAxis("Mouse Y") + joyY; |
|||
m_RotationX += mx * LookSpeed; |
|||
m_RotationY += my * LookSpeed; |
|||
m_RotationY = Mathf.Clamp(m_RotationY, -90f, 90f); |
|||
|
|||
transform.localRotation = Quaternion.AngleAxis(m_RotationX, Vector3.up); |
|||
transform.localRotation *= Quaternion.AngleAxis(m_RotationY, Vector3.left); |
|||
|
|||
float moveSpeed = Input.GetKey(KeyCode.LeftShift) || Input.GetButton("Fire1") |
|||
? MoveSpeed * 2f |
|||
: MoveSpeed; |
|||
transform.position += transform.forward * moveSpeed * Input.GetAxis("Vertical") * Time.deltaTime; |
|||
transform.position += transform.right * moveSpeed * Input.GetAxis("Horizontal") * Time.deltaTime; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 79d9c15c92bb0084d80fb50abc1c2e98 |
|||
timeCreated: 1483973718 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Assets/TestScenes/HDTest/GlobalIlluminationTest/LightingData.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 294c7f8b138fe394b907bd5382401e46 |
|||
timeCreated: 1483971268 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: eb8a3d63ad4e60a4dbf178b7f7bc0404 |
|||
folderAsset: yes |
|||
timeCreated: 1483636323 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: b4945bd06b6687e408c75d27ba1fc309 |
|||
folderAsset: yes |
|||
timeCreated: 1483636569 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue