Weapon.cs 865 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using UnityEngine;
  2. using System.Collections;
  3. public abstract class Weapon : MonoBehaviour
  4. {
  5. public PickupType type;
  6. public PoolObject condomPrefab;
  7. public bool isAutomatic = false;
  8. public SoundEvent fireSound = SoundEvent.shoot;
  9. private Pool _condomsPool;
  10. public virtual void Arm()
  11. {
  12. AVDebug.Log("Arming "+type+" at tick "+RecordingManager.Ticks);
  13. _condomsPool = Pool.Get(condomPrefab);
  14. AVDebug.Assert(_condomsPool != null, "Make sure that you have initialised the pool of "+condomPrefab+" in the PrePooler found in the BootStrap gameObject");
  15. }
  16. public virtual void Disarm()
  17. {
  18. AVDebug.Log("Disarming "+type);
  19. }
  20. public virtual void UpdateWeapon()
  21. {
  22. //do nothing
  23. }
  24. public virtual PoolObject Fire()
  25. {
  26. SoundManager.Play(fireSound);
  27. return _condomsPool.Spawn();
  28. }
  29. public virtual bool IsEmpty
  30. {
  31. get
  32. {
  33. return false;
  34. }
  35. }
  36. }