CameraControl
parent
8b1cde9c84
commit
c594388ec7
@ -0,0 +1,30 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class CameraManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Transform MainCam;
|
||||||
|
public Transform StartingCamera;
|
||||||
|
Vector3 MainCamEulerAngles;
|
||||||
|
public Transform target; // Reference to the character
|
||||||
|
public float speed;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
MainCamEulerAngles = MainCam.eulerAngles;
|
||||||
|
Invoke(nameof(StartingGameObjDisabler), 2.5f);
|
||||||
|
}
|
||||||
|
void StartingGameObjDisabler()
|
||||||
|
{
|
||||||
|
StartingCamera.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (speed < 1)
|
||||||
|
speed += Time.deltaTime/10;
|
||||||
|
StartingCamera.position = Vector3.Lerp(StartingCamera.position, MainCam.position, speed);
|
||||||
|
StartingCamera.LookAt(target);
|
||||||
|
//StartingCamera.eulerAngles=Vector3.Lerp(StartingCamera.eulerAngles, MainCamEulerAngles, Time.deltaTime);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c1866f6ccac147a4b92afc91593387f7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue