Ejemplo n.º 1
0
 public void RemoveShoot(IShoot shoot)
 {
     if (Shoots.Contains(shoot))
     {
         Shoots.Remove(shoot);
         _drawer.Remove(shoot);
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     ammoIndex = 0;
     Shooter   = GetComponent <IShoot>();
     Ammos.Add(Resources.Load <GameObject>("Prefab/Bullet"));
     Ammos.Add(Resources.Load <GameObject>("Prefab/ShockBullet"));
     GameObject.Find("GameBtns").GetComponent <GameBtns>().OnChangeAmmo += Change;
 }
Ejemplo n.º 3
0
    private void Awake()
    {
        playerCamera   = GetComponentInChildren <PlayerCamera> ();
        weaponSwitcher = GetComponentInChildren <WeaponSwitching> ();
        player         = GetComponent <Player> ();

        weapon = weaponSwitcher?.SelectWeapon();
    }
Ejemplo n.º 4
0
    public IShoot SelectWeapon()
    {
        IShoot wea = null;
        int    i   = 0;

        foreach (Transform weapon in transform)
        {
            if (i == selectedWeapon)
            {
                weapon.gameObject.SetActive(true);
                wea = weapon.GetComponent <IShoot> ();
            }
            else
            {
                weapon.gameObject.SetActive(false);
            }
            i++;
        }
        return(wea);
    }
Ejemplo n.º 5
0
        public Ship(IMove moveImplementation, IRotation rotationImplementation, IShoot shootImplementation,
                    Transform transform, ITransformRegistry transformRegistry, Stat health,
                    ShipMarkUp shipGameObjectMarkUp)
        {
            _moveImplementation     = moveImplementation;
            _rotationImplementation = rotationImplementation;
            shooter = shootImplementation;

            GameTransform         = transform;
            TransformRegistryBind = transformRegistry;
            TransformRegistryBind.RegisterTransform(this, GameTransform);

            StatHolder = new StatHolder();
            healthStat = health;
            healthStat.CurrentChanged += ProcessHealthChange;
            StatHolder.AddStat(StatType.Health, healthStat);

            colliderListener = shipGameObjectMarkUp.ColliderListener;
            colliderListener.EnterCollider += ProcessCollisions;
        }
Ejemplo n.º 6
0
    private void SwitchWaepon()
    {
        if (weaponSwitcher != null)
        {
            if (Input.GetAxis("Mouse ScrollWheel") > 0)
            {
                weaponSwitcher.SelectedWeapon = 1;
            }
            else if (Input.GetAxis("Mouse ScrollWheel") < 0)
            {
                weaponSwitcher.SelectedWeapon = -1;
            }

            weapon = weaponSwitcher.SelectWeapon();
        }
        else
        {
            Debug.Log("No weapon holder!");
        }
    }
Ejemplo n.º 7
0
 public void Start()
 {
     _launcher = GetComponent <IShoot>();
 }
Ejemplo n.º 8
0
 private void Start()
 {
     m_Weapon = GetComponent <IShoot>();
 }
Ejemplo n.º 9
0
 public Ship(IMove moveImplementation, IRotation rotationImplementation, IShoot shootImplementation)
 {
     _moveImplementation     = moveImplementation;
     _rotationImplementation = rotationImplementation;
     _shootImplementation    = shootImplementation;
 }
Ejemplo n.º 10
0
 private void Awake()
 {
     _shootModule = _shootModuleObject.GetComponent <IShoot>();
 }
 protected virtual void Awake()
 {
     bugDetermination = GetComponent <IBugDetermination>();
     shooting         = GetComponent <IShoot <AbstractDeveloper> >();
     attacks          = GetComponents <IAttack <AbstractDeveloper> >().ToList();
 }
Ejemplo n.º 12
0
 public void AddShoot(IShoot shoot)
 {
     Shoots.Add(shoot);
     _drawer.Add(shoot, _resourceRepository.GetTextureByType(shoot.GetType()));
 }
Ejemplo n.º 13
0
 public void SetGun(IShoot gun)
 {
     this.gun = gun;
 }
Ejemplo n.º 14
0
        void Start()
        {
            shootableMask = LayerMask.GetMask("Shootable");
            gun = GetComponentInChildren<IShoot>();

            if (gun != null)
            {
                gun.Enable(this);
            }
        }
Ejemplo n.º 15
0
 public SuperHeroAdapter(IFly fly, IShoot shoot, IGo go)
 {
     _fly   = fly;
     _shoot = shoot;
     _go    = go;
 }
Ejemplo n.º 16
0
 public bool Collides(IShoot shoot, IBlock block)
 {
     return(base.Collides(shoot, block));
 }
Ejemplo n.º 17
0
 public SuperheroAdapter(IFly fly, IShoot shoot, IWalls walls)
 {
     _fly   = fly;
     _shoot = shoot;
     _walls = walls;
 }