AVANCE 7
UPGRADE SYSTEM » Devlog
Hice el script para activar y desactivar las armas que se ve así para cada arma.
public class ChangeGun : MonoBehaviour
{
public static ChangeGun Instance; // Singleton
public GameObject gunA, gunB, gunC, gunD, gunE, gunF;
private void Awake()
{
// Configuramos el Singleton
if (Instance != null && Instance != this)
{
Destroy(gameObject); // Destruye duplicados
}
else
{
Instance = this;
DontDestroyOnLoad(gameObject); // Hace persistente el objeto entre escenas si es necesario
}
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Alpha1))
{
WeaponReader.Instance.UpdateGun(0);
gunA.SetActive(false);
gunB.SetActive(false);
gunC.SetActive(true);
gunD.SetActive(false);
gunE.SetActive(false);
gunF.SetActive(false);
}
De igual forma empecé a trabajar en el script donde se encontrarían las variables y funcionalidades, este script tenia un poco de estructura por lo que estaba intentando hacer antes.
UPGRADE SYSTEM
| Status | In development |
| Author | lissethmte |
| Genre | Shooter |
Leave a comment
Log in with itch.io to leave a comment.