init
This commit is contained in:
commit
bd5b1556ff
269 changed files with 6249829 additions and 0 deletions
27
Assets/Scripts/CineCamChange.cs
Normal file
27
Assets/Scripts/CineCamChange.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Cinemachine;
|
||||
|
||||
public class CineCamChange : MonoBehaviour{
|
||||
|
||||
CinemachineVirtualCamera vcam;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake(){
|
||||
vcam = GetComponentInChildren<CinemachineVirtualCamera>();
|
||||
vcam.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col){
|
||||
if (col.CompareTag("Player")){
|
||||
vcam.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerExit2D(Collider2D col){
|
||||
if (col.CompareTag("Player")){
|
||||
vcam.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue