public static int Update(IPlayer mario, IFire fire, Collision.CollisionType collisionType) { switch (collisionType) { case Collision.CollisionType.Above: fire.Attack(mario); return((int)Enum.DisableMovementType.Down); case Collision.CollisionType.Below: fire.Attack(mario); return((int)Enum.DisableMovementType.Up); case Collision.CollisionType.Left: fire.Attack(mario); return((int)Enum.DisableMovementType.Right); case Collision.CollisionType.Right: fire.Attack(mario); return((int)Enum.DisableMovementType.Left); default: return((int)Enum.DisableMovementType.None); } }
public void setWeapon(IFire iweapon) { if (currentWeapon == iweapon) { Debug.Log("Load failed, already same weapon"); return; } currentWeapon = iweapon; }
private void EquipMuffler() { var muffler = new Muffler(_audioClipMuffler, _volumeFireOnMuffler, _barrelPosition, _muffler); ModificationWeapon modificationWeapon = new ModificationMuffler(_audioSource, muffler, _barrelPositionMuffler.position); modificationWeapon.ApplyModification(_weapon); _equippedModifiers.Add(modificationWeapon); _fire = modificationWeapon; }
private void UnequipAllModifiers(List <ModificationWeapon> modificationWeapons) { foreach (var modify in modificationWeapons) { Destroy(modify.GetProvider()); _fire = _weapon = InitializeDefaultWeapon(); } _equippedModifiers.Clear(); }
private void Start() { IAmmunition ammunition = new Bullet(_bullet, 3.0f); var weapon = new Weapon(_barrelPosition, _audioClip, _audioSource, ammunition, 999.0f); var muffler = new Muffler(_muffler, _volumeFireOnMuffler, _audioClipMuffler, _barrelPositionMuffler); ModificationWeapon modificationWeapon = new ModificationMuffler(_audioSource, muffler, _barrelPositionMuffler.position); modificationWeapon.ApplyModification(weapon); _fire = modificationWeapon; //_fire = weapon; }
private void Start() { IAmmunition ammunition = new Bullet(_bullet, 3.0f); var weapon = new Weapon(ammunition, _barrelPosition, 999.0f, _audioSource, _audioClip); var muffler = new Muffler(_audioClipMuffler, _volumeFireOnMuffler, _barrelPosition, _muffler); var aim = new Aim(_barrelPositionAim, _aim); ModificationWeapon modificationWeapon = new ModificationMuffler(_audioSource, muffler, _barrelPositionMuffler.position); modificationWeapon.ApplyModification(weapon); //modificationWeapon.DeleteMidification(weapon); modificationWeapon = new ModificationAim(aim, _barrelPositionAim.position); modificationWeapon.ApplyModification(weapon); //modificationWeapon.DeleteMidification(weapon); _fire = modificationWeapon; }
private void CheckInput() { if (!fireObject) { return; } if (CanShoot()) { Debug.Log("Able To Shoot"); iFire.OnUpdatePosition(firePoint); if (Input.GetKeyDown(KeyCode.Mouse0)) { Debug.Log("Shooting"); //Shooting fireObject = false; iFire.Fire(); iFire = null; } } }
public void Initialization() { _iMove = Object.FindObjectOfType <CurrentPlayerMove>(); _iFire = Object.FindObjectOfType <CurrentPlayerFire>(); }
private void Awake() { _camera = Camera.main; _fire = new Enemy(); }
public void Crashing(IFire fire) { throw new NotImplementedException(); }
public void Crashing(IFire fire) { }
void Start() { currentWeapon = new Pistol(); }
private void Start() { _ammunition = new Bullet(_bullet, 3.0f); _weapon = InitializeDefaultWeapon(); _fire = _weapon; }