public void RemoveShoot(IShoot shoot) { if (Shoots.Contains(shoot)) { Shoots.Remove(shoot); _drawer.Remove(shoot); } }
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; }
private void Awake() { playerCamera = GetComponentInChildren <PlayerCamera> (); weaponSwitcher = GetComponentInChildren <WeaponSwitching> (); player = GetComponent <Player> (); weapon = weaponSwitcher?.SelectWeapon(); }
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); }
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; }
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!"); } }
public void Start() { _launcher = GetComponent <IShoot>(); }
private void Start() { m_Weapon = GetComponent <IShoot>(); }
public Ship(IMove moveImplementation, IRotation rotationImplementation, IShoot shootImplementation) { _moveImplementation = moveImplementation; _rotationImplementation = rotationImplementation; _shootImplementation = shootImplementation; }
private void Awake() { _shootModule = _shootModuleObject.GetComponent <IShoot>(); }
protected virtual void Awake() { bugDetermination = GetComponent <IBugDetermination>(); shooting = GetComponent <IShoot <AbstractDeveloper> >(); attacks = GetComponents <IAttack <AbstractDeveloper> >().ToList(); }
public void AddShoot(IShoot shoot) { Shoots.Add(shoot); _drawer.Add(shoot, _resourceRepository.GetTextureByType(shoot.GetType())); }
public void SetGun(IShoot gun) { this.gun = gun; }
void Start() { shootableMask = LayerMask.GetMask("Shootable"); gun = GetComponentInChildren<IShoot>(); if (gun != null) { gun.Enable(this); } }
public SuperHeroAdapter(IFly fly, IShoot shoot, IGo go) { _fly = fly; _shoot = shoot; _go = go; }
public bool Collides(IShoot shoot, IBlock block) { return(base.Collides(shoot, block)); }
public SuperheroAdapter(IFly fly, IShoot shoot, IWalls walls) { _fly = fly; _shoot = shoot; _walls = walls; }