Exemplo n.º 1
0
 public void RemoveShoot(IShoot shoot)
 {
     if (Shoots.Contains(shoot))
     {
         Shoots.Remove(shoot);
         _drawer.Remove(shoot);
     }
 }
Exemplo 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;
 }
Exemplo n.º 3
0
    private void Awake()
    {
        playerCamera   = GetComponentInChildren <PlayerCamera> ();
        weaponSwitcher = GetComponentInChildren <WeaponSwitching> ();
        player         = GetComponent <Player> ();

        weapon = weaponSwitcher?.SelectWeapon();
    }
Exemplo 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);
    }
Exemplo 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;
        }
Exemplo 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!");
        }
    }
Exemplo n.º 7
0
 public void Start()
 {
     _launcher = GetComponent <IShoot>();
 }
Exemplo n.º 8
0
 private void Start()
 {
     m_Weapon = GetComponent <IShoot>();
 }
Exemplo n.º 9
0
 public Ship(IMove moveImplementation, IRotation rotationImplementation, IShoot shootImplementation)
 {
     _moveImplementation     = moveImplementation;
     _rotationImplementation = rotationImplementation;
     _shootImplementation    = shootImplementation;
 }
Exemplo 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();
 }
Exemplo n.º 12
0
 public void AddShoot(IShoot shoot)
 {
     Shoots.Add(shoot);
     _drawer.Add(shoot, _resourceRepository.GetTextureByType(shoot.GetType()));
 }
Exemplo n.º 13
0
 public void SetGun(IShoot gun)
 {
     this.gun = gun;
 }
Exemplo n.º 14
0
        void Start()
        {
            shootableMask = LayerMask.GetMask("Shootable");
            gun = GetComponentInChildren<IShoot>();

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