浏览代码

Fix cutscenes

/main
Chema Damak 4 年前
当前提交
093779d0
共有 7 个文件被更改,包括 683 次插入253 次删除
  1. 861
      UOP1_Project/Assets/Scenes/Examples/CutsceneExample.unity
  2. 33
      UOP1_Project/Assets/Scripts/Cutscenes/CutsceneManager.cs
  3. 2
      UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs
  4. 27
      UOP1_Project/Packages/packages-lock.json
  5. 4
      UOP1_Project/ProjectSettings/EditorBuildSettings.asset
  6. 2
      UOP1_Project/ProjectSettings/QualitySettings.asset
  7. 7
      UOP1_Project/Assets/Scenes/Examples/CutsceneExample.unity.meta

861
UOP1_Project/Assets/Scenes/Examples/CutsceneExample.unity
文件差异内容过多而无法显示
查看文件

33
UOP1_Project/Assets/Scripts/Cutscenes/CutsceneManager.cs


using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Playables;
public class CutsceneManager : MonoBehaviour

private void OnEnable()
{
_inputReader.gameInput.Dialogues.AdvanceDialogue.performed += ctx => OnAdvance();
_inputReader.advanceDialogueEvent += OnAdvance;
_inputReader.gameInput.Dialogues.AdvanceDialogue.performed -= ctx => OnAdvance();
_inputReader.advanceDialogueEvent -= OnAdvance;
_inputReader.EnableDialogueInput();
_activePlayableDirector.stopped += ctx => CutsceneEnded();
EnableDialogueInput();
_activePlayableDirector.stopped += HandleDirectorStopped;
UIManager.Instance.CloseUIDialogue();
EnableGameplayInput();
if (_activePlayableDirector != null)
_activePlayableDirector.stopped -= HandleDirectorStopped;
_inputReader.EnableGameplayInput();
private void HandleDirectorStopped(PlayableDirector director) => CutsceneEnded();
public void PlayDialogueFromClip(DialogueLineSO dialogueLine)
{
_dialogueManager.DisplayDialogueLine(dialogueLine);

_isPaused = false;
_activePlayableDirector.playableGraph.GetRootPlayable(0).SetSpeed(1);
}
private void EnableDialogueInput()
{
_inputReader.gameInput.Dialogues.Enable();
_inputReader.gameInput.Gameplay.Disable();
}
private void EnableGameplayInput()
{
_inputReader.gameInput.Gameplay.Enable();
_inputReader.gameInput.Dialogues.Disable();
}
}
}

2
UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs


/// <param name="firstLine"></param>
public void BeginDialogue(DialogueLineSO firstLine)
{
_inputReader.gameInput.Dialogues.Enable();
_inputReader.EnableDialogueInput();
DisplayDialogueLine(firstLine);
}

27
UOP1_Project/Packages/packages-lock.json


{
"dependencies": {
"com.unity.addressables": {
"version": "1.8.5",
"depth": 0,
"version": "1.16.6",
"depth": 1,
"com.unity.scriptablebuildpipeline": "1.7.3",
"com.unity.scriptablebuildpipeline": "1.13.1",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0"

"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.localization": {
"version": "0.9.0-preview",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.addressables": "1.16.6",
"com.unity.nuget.newtonsoft-json": "2.0.0"
},
"url": "https://packages.unity.com"
},
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "2.0.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"

"url": "https://packages.unity.com"
},
"com.unity.scriptablebuildpipeline": {
"version": "1.7.3",
"depth": 1,
"version": "1.13.1",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"

4
UOP1_Project/ProjectSettings/EditorBuildSettings.asset


- enabled: 1
path: Assets/Scenes/Locations/Beach.unity
guid: dfaf60263d5c5dc4e80e2793f4328b32
m_configObjects: {}
m_configObjects:
com.unity.addressableassets: {fileID: 11400000, guid: 758daf1c1b96e4978a5b9b3f5815abf1,
type: 2}

2
UOP1_Project/ProjectSettings/QualitySettings.asset


skinWeights: 4
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
antiAliasing: 2
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1

7
UOP1_Project/Assets/Scenes/Examples/CutsceneExample.unity.meta


fileFormatVersion: 2
guid: 54b0379f81d0e8b479ad9405fe862f25
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存