Estou desenvolvendo um jogo e, consegui desabilitar o objeto detentor do componente cinemachineVirtualCamera clicando em um botão de jogo de celular nomeado f, de foco e, não estou conseguindo habilitar novamente com o botão nomeado de w, w de warrior, usando event trigger e o script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class warrior_function : MonoBehaviour
{
public GameObject cinemachine;
private int apertado_botao;
private bool definir;
// Start is called before the first frame update
void Start()
{
definir = false;
cinemachine = GetComponent<GameObject>();
}
// Update is called once per frame
void Update()
{
if(apertado_botao == 2)
{
definir = true;
}
if(definir == true)
{
cinemachine.SetActive(true);
definir = false;
}
}
public void apertar_botao(int pressionado)
{
apertado_botao = pressionado;
}
}