Created camera script
This commit is contained in:
		@@ -116,7 +116,7 @@ Transform:
 | 
			
		||||
  m_PrefabAsset: {fileID: 0}
 | 
			
		||||
  m_GameObject: {fileID: 2662163039882375475}
 | 
			
		||||
  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_ConstrainProportionsScale: 0
 | 
			
		||||
  m_Children: []
 | 
			
		||||
@@ -271,6 +271,7 @@ GameObject:
 | 
			
		||||
  m_Component:
 | 
			
		||||
  - component: {fileID: 2662163040849090937}
 | 
			
		||||
  - component: {fileID: 2662163040849090936}
 | 
			
		||||
  - component: {fileID: 2020098282085569797}
 | 
			
		||||
  m_Layer: 0
 | 
			
		||||
  m_Name: CM vcam1
 | 
			
		||||
  m_TagString: Untagged
 | 
			
		||||
@@ -286,7 +287,7 @@ Transform:
 | 
			
		||||
  m_PrefabAsset: {fileID: 0}
 | 
			
		||||
  m_GameObject: {fileID: 2662163040849090938}
 | 
			
		||||
  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_ConstrainProportionsScale: 0
 | 
			
		||||
  m_Children:
 | 
			
		||||
@@ -332,3 +333,15 @@ MonoBehaviour:
 | 
			
		||||
        m_Calls: []
 | 
			
		||||
  m_LegacyBlendHint: 0
 | 
			
		||||
  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: 
 | 
			
		||||
 
 | 
			
		||||
@@ -3011,14 +3011,6 @@ PrefabInstance:
 | 
			
		||||
  m_Modification:
 | 
			
		||||
    m_TransformParent: {fileID: 0}
 | 
			
		||||
    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}
 | 
			
		||||
      propertyPath: m_RootOrder
 | 
			
		||||
      value: 3
 | 
			
		||||
@@ -3071,14 +3063,6 @@ PrefabInstance:
 | 
			
		||||
      propertyPath: m_Follow
 | 
			
		||||
      value: 
 | 
			
		||||
      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_SourcePrefab: {fileID: 100100000, guid: 1da5e227ed55bcd4b943e0ceef78aefb, type: 3}
 | 
			
		||||
--- !u!1001 &7008207193554258683
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								Assets/Scripts/Camera.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/Scripts/Camera.meta
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
fileFormatVersion: 2
 | 
			
		||||
guid: 1dd4ed9ed15bfbe4e826cb0763b86e43
 | 
			
		||||
folderAsset: yes
 | 
			
		||||
DefaultImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
							
								
								
									
										21
									
								
								Assets/Scripts/Camera/CameraPlayerFinder.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Assets/Scripts/Camera/CameraPlayerFinder.cs
									
									
									
									
									
										Normal 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;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								Assets/Scripts/Camera/CameraPlayerFinder.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/Camera/CameraPlayerFinder.cs.meta
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
fileFormatVersion: 2
 | 
			
		||||
guid: ca616a2edfacfd54fb236cd92b9e2dea
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
		Reference in New Issue
	
	Block a user