Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Cinemachine;
- using UnityEditor;
- public class vCmasSwitchingOnCollision : MonoBehaviour
- {
- [SerializeField] private CinemachineVirtualCameraBase[] _vCams;
- [SerializeField] private int _vCamsIndex = 0;
- [SerializeField] private GameObject _player;
- private CinemachineVirtualCameraBase _cam;
- // Start is called before the first frame update
- void Start()
- {
- _cam = GetComponent<CinemachineVirtualCameraBase>();
- EventManager.CollisionEvent01 += SwitchVcam;
- }
- private void SwitchVcam()
- {
- _vCams[0].gameObject.SetActive(true);
- }
- //How can we Subcribe this event like we did EventManager.CollisionEvent01 += SwitchVcam;
- private void OnTriggerEnter(Collider other)
- {
- if (other.gameObject.CompareTag("Player"))
- {
- Debug.Log("!!!!" + other.gameObject.name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement