Andre McGrail
7 年前
当前提交
11472116
共有 7 个文件被更改,包括 926 次插入 和 47 次删除
-
1Assets/Scripts/Camera/LODTweaker.cs
-
6Assets/Scripts/System/MaxLodOption.cs
-
812Assets/scenes/Island.unity
-
118Assets/Scripts/Camera/CameraManager.cs
-
11Assets/Scripts/Camera/CameraManager.cs.meta
-
17Assets/Scripts/Boat/CameraManager.cs
-
8Assets/Scripts/Boat/CameraManager.cs.meta
812
Assets/scenes/Island.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
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 |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e1fda60c295b14bfe8a944976316d510 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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 () { |
|||
|
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4b6eadf21a27c48a7980c786e888e534 |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
撰写
预览
正在加载...
取消
保存
Reference in new issue