private void NotifyWeaponSightLost(PickableWeapon weapon) { if (OnWeaponSightLost != null) { OnWeaponSightLost(weapon); } }
private void NotifyWeaponSeen(PickableWeapon weapon) { if (OnWeaponSeen != null) { OnWeaponSeen(weapon); } }
public void See(PickableWeapon weapon) { // if (!weaponsInSight.Contains(weapon)) // { weaponsInSight.Add(weapon); NotifyWeaponSeen(weapon); // } }
public void PickUpWeapon(Weapon weapon, Vector3 position) { if (equippedWeapons.ActiveWeapon == null) { activeWeaponObject = Instantiate(weapon, weaponSlot) as Weapon; equippedWeapons.ActiveWeapon = weapon; if (wUI) { wUI.UpdateState(equippedWeapons.ActiveWeapon.Icon, null); } } else if (equippedWeapons.InactiveWeapon == null) { equippedWeapons.InactiveWeapon = equippedWeapons.ActiveWeapon; inactiveWeaponObject = activeWeaponObject; inactiveWeaponObject.gameObject.SetActive(false); activeWeaponObject = Instantiate(weapon, weaponSlot) as Weapon; equippedWeapons.ActiveWeapon = weapon; if (wUI) { wUI.UpdateState(equippedWeapons.ActiveWeapon.Icon, equippedWeapons.InactiveWeapon.Icon); } } else { PickableWeapon pickableWeapon = Instantiate(pickableWeaponPrefab) as PickableWeapon; pickableWeapon.transform.position = position; pickableWeapon.Initialize(equippedWeapons.ActiveWeapon); Destroy(activeWeaponObject.gameObject); activeWeaponObject = Instantiate(weapon, weaponSlot) as Weapon; equippedWeapons.ActiveWeapon = weapon; if (wUI) { wUI.UpdateState(equippedWeapons.ActiveWeapon.Icon, equippedWeapons.InactiveWeapon.Icon); } } }
public void OnPickUp(PickableWeapon pickableWeapon) { PickableWeapon = pickableWeapon; }
public void LooseSightOf(PickableWeapon weapon) { weaponsInSight.Remove(weapon); NotifyWeaponSightLost(weapon); }
private void InitializeComponent() { weapon = transform.GetComponent <PickableWeapon>(); }