12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using UnityEngine;
- using System.Collections;
- public abstract class Weapon : MonoBehaviour
- {
- public PickupType type;
- public PoolObject condomPrefab;
- public bool isAutomatic = false;
- public SoundEvent fireSound = SoundEvent.shoot;
- private Pool _condomsPool;
- public virtual void Arm()
- {
- AVDebug.Log("Arming "+type+" at tick "+RecordingManager.Ticks);
- _condomsPool = Pool.Get(condomPrefab);
- AVDebug.Assert(_condomsPool != null, "Make sure that you have initialised the pool of "+condomPrefab+" in the PrePooler found in the BootStrap gameObject");
- }
- public virtual void Disarm()
- {
- AVDebug.Log("Disarming "+type);
- }
- public virtual void UpdateWeapon()
- {
- //do nothing
- }
- public virtual PoolObject Fire()
- {
- SoundManager.Play(fireSound);
- return _condomsPool.Spawn();
- }
- public virtual bool IsEmpty
- {
- get
- {
- return false;
- }
- }
- }
|