浏览代码

Added camera controls

Setup LOD max level 2 for reflection camera
/main
Andre McGrail 7 年前
当前提交
11472116
共有 7 个文件被更改,包括 926 次插入47 次删除
  1. 1
      Assets/Scripts/Camera/LODTweaker.cs
  2. 6
      Assets/Scripts/System/MaxLodOption.cs
  3. 812
      Assets/scenes/Island.unity
  4. 118
      Assets/Scripts/Camera/CameraManager.cs
  5. 11
      Assets/Scripts/Camera/CameraManager.cs.meta
  6. 17
      Assets/Scripts/Boat/CameraManager.cs
  7. 8
      Assets/Scripts/Boat/CameraManager.cs.meta

1
Assets/Scripts/Camera/LODTweaker.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
[ExecuteInEditMode]
public class LODTweaker : MonoBehaviour {
void SetMaxLOD(Camera cam)

6
Assets/Scripts/System/MaxLodOption.cs


public Text displayText;
private void Start() {
curlevel = QualitySettings.maximumLODLevel;
curlevel = (int)QualitySettings.lodBias;
displayText.text = curlevel.ToString();
}

curlevel++;
QualitySettings.maximumLODLevel = curlevel;
QualitySettings.lodBias = curlevel;
displayText.text = curlevel.ToString();
}

curlevel--;
QualitySettings.maximumLODLevel = curlevel;
QualitySettings.lodBias = curlevel;
displayText.text = curlevel.ToString();
}
}

812
Assets/scenes/Island.unity
文件差异内容过多而无法显示
查看文件

118
Assets/Scripts/Camera/CameraManager.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using Cinemachine;
using UnityEngine.UI;
public class CameraManager : MonoBehaviour {
public CameraModes _camModes;
public PlayableDirector _cutsceneDirector;
public List<CinemachineVirtualCamera> _cutsceneCameras = new List<CinemachineVirtualCamera>();
public CinemachineVirtualCamera _droneCamera;
public CinemachineVirtualCamera _raceCamera;
public CinemachineClearShot _replayShots;
public Text _staticCamText;
private int _curStaticCam = 0;
public void PlayCutscene()
{
// Lower other camera priorities
_droneCamera.Priority = 5;
_raceCamera.Priority = 5;
_replayShots.Priority = 5;
// activate cutscene
_cutsceneDirector.enabled = true;
_cutsceneDirector.Stop();
_cutsceneDirector.Play();
}
void DisableCutscene()
{
_cutsceneDirector.enabled = false;
_cutsceneDirector.Stop();
}
public void DroneCam()
{
// Lower other camera priorities
DisableCutscene();
_raceCamera.Priority = 5;
_replayShots.Priority = 5;
// activate drone
_droneCamera.Priority = 15;
}
public void RaceCam()
{
// Lower other camera priorities
DisableCutscene();
_droneCamera.Priority = 5;
_replayShots.Priority = 5;
// activate drone
_raceCamera.Priority = 15;
}
public void ReplayCam()
{
// Lower other camera priorities
DisableCutscene();
_droneCamera.Priority = 5;
_raceCamera.Priority = 5;
// activate drone
_replayShots.Priority = 15;
}
public void StaticCams()
{
// Lower other camera priorities
DisableCutscene();
_droneCamera.Priority = 5;
_raceCamera.Priority = 5;
_replayShots.Priority = 5;
SetStaticCam(_curStaticCam);
}
public void NextStaticCam()
{
_curStaticCam++;
if(_curStaticCam == _cutsceneCameras.Count)
_curStaticCam = 0;
SetStaticCam(_curStaticCam);
}
public void PrevStaticCam()
{
_curStaticCam--;
if(_curStaticCam < 0)
_curStaticCam = _cutsceneCameras.Count - 1;
SetStaticCam(_curStaticCam);
}
void SetStaticCam(int cameraIndex)
{
for(var i = 0; i < _cutsceneCameras.Count; i++)
{
if(i != cameraIndex)
{
_cutsceneCameras[i].Priority = 5;
}
else
{
_cutsceneCameras[i].Priority = 11;
_staticCamText.text = _cutsceneCameras[i].gameObject.name.Substring(9);
}
}
}
public enum CameraModes
{
Cutscene,
Race,
Drone,
Replay,
Static
}
}

11
Assets/Scripts/Camera/CameraManager.cs.meta


fileFormatVersion: 2
guid: e1fda60c295b14bfe8a944976316d510
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

17
Assets/Scripts/Boat/CameraManager.cs


using UnityEngine;
using System.Collections;
public class CameraManager : MonoBehaviour {
public GameObject CamGrp;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}

8
Assets/Scripts/Boat/CameraManager.cs.meta


fileFormatVersion: 2
guid: 4b6eadf21a27c48a7980c786e888e534
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
正在加载...
取消
保存