Created camera script

This commit is contained in:
OverflowNarhoym 2022-02-25 21:38:09 +01:00
parent 07a542a990
commit 1ca81682f8
5 changed files with 55 additions and 18 deletions

View File

@ -116,7 +116,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2662163039882375475} m_GameObject: {fileID: 2662163039882375475}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 6.536235, y: 1.9904585, z: -9.967962} m_LocalPosition: {x: 14.936234, y: -8.049541, z: -9.967962}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -271,6 +271,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 2662163040849090937} - component: {fileID: 2662163040849090937}
- component: {fileID: 2662163040849090936} - component: {fileID: 2662163040849090936}
- component: {fileID: 2020098282085569797}
m_Layer: 0 m_Layer: 0
m_Name: CM vcam1 m_Name: CM vcam1
m_TagString: Untagged m_TagString: Untagged
@ -286,7 +287,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2662163040849090938} m_GameObject: {fileID: 2662163040849090938}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 6.536235, y: 1.9904585, z: -9.967962} m_LocalPosition: {x: 14.936234, y: -8.049541, z: -9.967962}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@ -332,3 +333,15 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_LegacyBlendHint: 0 m_LegacyBlendHint: 0
m_ComponentOwner: {fileID: 2662163039850151874} m_ComponentOwner: {fileID: 2662163039850151874}
--- !u!114 &2020098282085569797
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2662163040849090938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ca616a2edfacfd54fb236cd92b9e2dea, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -3011,14 +3011,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 0} m_TransformParent: {fileID: 0}
m_Modifications: m_Modifications:
- target: {fileID: 2662163039882375472, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3}
propertyPath: m_LocalPosition.x
value: 14.936234
objectReference: {fileID: 0}
- target: {fileID: 2662163039882375472, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3}
propertyPath: m_LocalPosition.y
value: -8.049541
objectReference: {fileID: 0}
- target: {fileID: 2662163039948621854, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} - target: {fileID: 2662163039948621854, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 3
@ -3071,14 +3063,6 @@ PrefabInstance:
propertyPath: m_Follow propertyPath: m_Follow
value: value:
objectReference: {fileID: 1053905692} objectReference: {fileID: 1053905692}
- target: {fileID: 2662163040849090937, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3}
propertyPath: m_LocalPosition.x
value: 14.936234
objectReference: {fileID: 0}
- target: {fileID: 2662163040849090937, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3}
propertyPath: m_LocalPosition.y
value: -8.049541
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3}
--- !u!1001 &7008207193554258683 --- !u!1001 &7008207193554258683

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1dd4ed9ed15bfbe4e826cb0763b86e43
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
using Cinemachine;
using UnityEngine;
namespace Camera
{
public class CameraPlayerFinder : MonoBehaviour
{
private CinemachineVirtualCamera _cinemachineVirtualCamera;
private void Awake()
{
_cinemachineVirtualCamera = GetComponent<CinemachineVirtualCamera>();
}
private void Update()
{
if (_cinemachineVirtualCamera.Follow == null)
_cinemachineVirtualCamera.Follow = GameObject.Find("Player").transform;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ca616a2edfacfd54fb236cd92b9e2dea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: