private void Awake() { _muzzles = GetMuzzles(); _fireParticles = GetFireParticles(_muzzles); _fireAnimation = GetComponent <IFireAnimation>() ?? new NoFireAnimation(); _fireControl = GetComponent <IFireSequence>() ?? new InstantFireSequence(); _fireSync = GetComponent <IFireControl>() ?? new NoFireControl(); _pool = new NoGameObjectPool <IProjectile>(ProjectilePrefab); _projectilePool = new ProjectilePool(_pool); _pool.OnNew += OnNewProjectile; if (isActiveAndEnabled) { _chambered = false; StartCoroutine(Rechamber(Cooldown)); } }
public void Start() { _gunPointer = gameObject.transform.GetChild(1); _fireAnim = GetComponent <IFireAnimation>(); }