浏览代码

Location entrance camera

We can now configure a custom camera shot for each location entrance
/main
Ciro Continisio 3 年前
当前提交
34861adb
共有 4 个文件被更改,包括 166 次插入15 次删除
  1. 25
      UOP1_Project/Assets/Prefabs/Gameplay/CameraSystem.prefab
  2. 119
      UOP1_Project/Assets/Prefabs/Gameplay/LocationEntrance.prefab
  3. 31
      UOP1_Project/Assets/Scripts/SceneManagement/LocationEntrance.cs
  4. 6
      UOP1_Project/Assets/Scripts/SceneManagement/LocationEntrance.cs.meta

25
UOP1_Project/Assets/Prefabs/Gameplay/CameraSystem.prefab


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1988373824387590796}
m_LocalRotation: {x: 0.060630158, y: 0.6756655, z: -0.055919778, w: 0.7325798}
m_LocalRotation: {x: -0, y: -0.000000022351742, z: 0.000000003259629, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

ModeOverride: 0
LensShift: {x: 0, y: 0}
GateFit: 2
m_SensorSize: {x: 0.9393531, y: 1}
m_SensorSize: {x: 3.256917, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5457523176376150323}
m_LocalRotation: {x: 0.11774746, y: 0.6692212, z: -0.10859963, w: 0.7255927}
m_LocalRotation: {x: 0.07822093, y: -0.000000037252903, z: 0.000000010244548, w: 0.9969361}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

ModeOverride: 0
LensShift: {x: 0, y: 0}
GateFit: 2
m_SensorSize: {x: 0.9393531, y: 1}
m_SensorSize: {x: 3.256917, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6333144650067166509}
m_LocalRotation: {x: 0.1011553, y: 0.6715257, z: -0.09329654, w: 0.7280911}
m_LocalRotation: {x: 0.055445746, y: -0.000000014901161, z: 0.0000000018626451,
w: 0.9984617}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

ModeOverride: 0
LensShift: {x: 0, y: 0}
GateFit: 2
m_SensorSize: {x: 0.9393531, y: 1}
m_SensorSize: {x: 3.256917, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8745341641394998848}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -5.9804316, y: 3, z: -0.4841891}
m_LocalRotation: {x: 0.08212709, y: 0.09216257, z: -0.007627607, w: 0.992322}
m_LocalPosition: {x: -1.1049764, y: 3, z: -5.8973746}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2955398947125553842}

ModeOverride: 0
LensShift: {x: 0, y: 0}
GateFit: 2
m_SensorSize: {x: 0.9393531, y: 1}
m_SensorSize: {x: 3.256917, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 1

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8745341642014614487}
m_LocalRotation: {x: 0.08222723, y: 0.078046985, z: -0.006459366, w: 0.9935319}
m_LocalPosition: {x: -0.9368795, y: 3, z: -5.9264035}
m_LocalRotation: {x: 0.08212709, y: 0.09216256, z: -0.007627606, w: 0.992322}
m_LocalPosition: {x: -1.1049764, y: 3, z: -5.8973746}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8745341640208226295}

m_BlendUpdateMethod: 1
m_DefaultBlend:
m_Style: 1
m_Time: 1
m_Time: 2
m_CustomCurve:
serializedVersion: 2
m_Curve: []

119
UOP1_Project/Assets/Prefabs/Gameplay/LocationEntrance.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &265517182190813805
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 130192914263924118}
- component: {fileID: 9177227457611581011}
m_Layer: 0
m_Name: CM vcam1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &130192914263924118
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 265517182190813805}
m_LocalRotation: {x: -0.12806746, y: 0.093507916, z: -0.012161177, w: -0.9872726}
m_LocalPosition: {x: 2.129344, y: 3.6942506, z: -11.94936}
m_LocalScale: {x: 0.9999996, y: 1, z: 0.9999996}
m_Children:
- {fileID: 5725277623085127369}
m_Father: {fileID: 5540501665159811850}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &9177227457611581011
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 265517182190813805}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e653bab7fb20e499bda25e1b646fea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ExcludedPropertiesInInspector:
- m_Script
m_LockStageInInspector:
m_StreamingVersion: 20170927
m_Priority: -1
m_StandbyUpdate: 2
m_LookAt: {fileID: 0}
m_Follow: {fileID: 0}
m_Lens:
FieldOfView: 60
OrthographicSize: 10
NearClipPlane: 0.01
FarClipPlane: 2000
Dutch: 0
ModeOverride: 0
LensShift: {x: 0, y: 0}
GateFit: 2
m_SensorSize: {x: 1.8344828, y: 1}
m_Transitions:
m_BlendHint: 1
m_InheritPosition: 0
m_OnCameraLive:
m_PersistentCalls:
m_Calls: []
m_LegacyBlendHint: 0
m_ComponentOwner: {fileID: 5725277623085127369}
--- !u!1 &2023086011890440699
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5725277623085127369}
- component: {fileID: 1441069580997817315}
m_Layer: 0
m_Name: cm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5725277623085127369
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2023086011890440699}
m_LocalRotation: {x: -0.3214424, y: -0.38290328, z: 0.1441246, w: 0.85398364}
m_LocalPosition: {x: -237.65785, y: 188.8828, z: 226.1085}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 130192914263924118}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1441069580997817315
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2023086011890440699}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5540501665159811849
GameObject:
m_ObjectHideFlags: 0

m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 130192914263924118}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_Name:
m_EditorClassIdentifier:
_entrancePath: {fileID: 0}
_pathStorage: {fileID: 11400000, guid: a9ec09853cba047a8a58f5881053cfc6, type: 2}
entranceShot: {fileID: 9177227457611581011}
_onSceneReady: {fileID: 11400000, guid: b729e40fc41dd8b4ea7aaf5c857f7186, type: 2}
--- !u!114 &1771713970578625073
MonoBehaviour:
m_ObjectHideFlags: 0

31
UOP1_Project/Assets/Scripts/SceneManagement/LocationEntrance.cs


using System.Collections;
using Cinemachine;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[SerializeField] private PathStorageSO _pathStorage = default; //This is where the last path taken has been stored
[SerializeField] private CinemachineVirtualCamera entranceShot;
[Header("Lisenting on")]
[SerializeField] private VoidEventChannelSO _onSceneReady;
private void Awake()
{
if(_pathStorage.lastPathTaken == _entrancePath)
{
entranceShot.Priority = 100;
_onSceneReady.OnEventRaised += PlanTransition;
}
}
private void PlanTransition()
{
StartCoroutine(TransitionToGameCamera());
}
private IEnumerator TransitionToGameCamera()
{
yield return new WaitForSeconds(.1f);
entranceShot.Priority = -1;
_onSceneReady.OnEventRaised -= PlanTransition;
}
}

6
UOP1_Project/Assets/Scripts/SceneManagement/LocationEntrance.cs.meta


MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
defaultReferences:
- _entrancePath: {instanceID: 0}
- _pathStorage: {fileID: 11400000, guid: a9ec09853cba047a8a58f5881053cfc6, type: 2}
- entranceShot: {instanceID: 0}
- _onSceneReady: {fileID: 11400000, guid: b729e40fc41dd8b4ea7aaf5c857f7186, type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:
正在加载...
取消
保存