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);
     // }
 }
예제 #4
0
 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);
         }
     }
 }
예제 #5
0
 public void OnPickUp(PickableWeapon pickableWeapon)
 {
     PickableWeapon = pickableWeapon;
 }
 public void LooseSightOf(PickableWeapon weapon)
 {
     weaponsInSight.Remove(weapon);
     NotifyWeaponSightLost(weapon);
 }
예제 #7
0
 private void InitializeComponent()
 {
     weapon = transform.GetComponent <PickableWeapon>();
 }