private void EquipWeapons() { if (frontWeaponObject != null) { frontWeaponObject.gameObject.SetActive(false); } if (backWeaponObject != null) { backWeaponObject.gameObject.SetActive(false); } RobotWeaponsManager weaponsManager = RobotWeaponsManager.Instance; RobotWeapon frontWeapon = weaponsManager.FrontWeapon; if (frontWeapon != null) { frontWeaponObject = Instantiate(weaponsManager.FrontWeapon.prefab, configuration.FrontWeaponPosition.position, Quaternion.identity, transform); frontWeaponObject.EquipToPlayer(gameObject); } else { Debug.Log("no front weapon equipped, not instantiating"); } RobotWeapon backWeapon = weaponsManager.BackWeapon; if (backWeapon != null) { backWeaponObject = Instantiate(weaponsManager.BackWeapon.prefab, configuration.BackWeaponPosition.position, Quaternion.identity, transform); backWeaponObject.EquipToPlayer(gameObject); } else { Debug.Log("no back weapon equipped, not instantiating"); } }
// Start is called before the first frame update void Start() { RobotWeaponsManager manager = RobotWeaponsManager.Instance; foreach (var weapon in weaponsToUnlock) { manager.UnlockWeapon(weapon); } }
private void Awake() { if (m_instance != null && m_instance != this) { Destroy(this.gameObject); } else { DontDestroyOnLoad(this); m_instance = this; } unlockedWeapons = new HashSet <RobotWeapon>(); }