Added auto-save
This commit is contained in:
parent
09973676e1
commit
8857a11038
8 changed files with 206 additions and 21 deletions
|
@ -5,6 +5,7 @@ namespace SimpleTools.Cinemachine {
|
|||
public class CMCameraTrigger : MonoBehaviour {
|
||||
|
||||
CinemachineVirtualCamera vcam;
|
||||
[SerializeField, Tooltip("Name of the collider's tag that will trigger the camera.")] string triggerTagName;
|
||||
|
||||
void Awake() {
|
||||
vcam = GetComponentInChildren<CinemachineVirtualCamera>(true);
|
||||
|
@ -13,12 +14,12 @@ namespace SimpleTools.Cinemachine {
|
|||
|
||||
#region 3D
|
||||
void OnTriggerEnter(Collider col) {
|
||||
if (col.CompareTag("Player")) {
|
||||
if (col.CompareTag(triggerTagName)) {
|
||||
vcam.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
void OnTriggerExit(Collider col) {
|
||||
if (col.CompareTag("Player")) {
|
||||
if (col.CompareTag(triggerTagName)) {
|
||||
vcam.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
@ -26,12 +27,12 @@ namespace SimpleTools.Cinemachine {
|
|||
|
||||
#region 2D
|
||||
void OnTriggerEnter2D(Collider2D col) {
|
||||
if (col.CompareTag("Player")) {
|
||||
if (col.CompareTag(triggerTagName)) {
|
||||
vcam.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
void OnTriggerExit2D(Collider2D col) {
|
||||
if (col.CompareTag("Player")) {
|
||||
if (col.CompareTag(triggerTagName)) {
|
||||
vcam.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue