Exemplo n.º 1
0
        private String ExecuteFiringSequence(IFireSequence sequence) {
            String msg = "Shots fired: ";

            sequence.Launch(map);

            msg = map.FiredShotsResults();
            map.resetResults();
            Console.WriteLine(msg);
            return msg;
        }
Exemplo n.º 2
0
        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));
            }
        }