Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public void setWeapon(IFire iweapon)
 {
     if (currentWeapon == iweapon)
     {
         Debug.Log("Load failed, already same weapon");
         return;
     }
     currentWeapon = iweapon;
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        private void UnequipAllModifiers(List <ModificationWeapon> modificationWeapons)
        {
            foreach (var modify in modificationWeapons)
            {
                Destroy(modify.GetProvider());
                _fire = _weapon = InitializeDefaultWeapon();
            }

            _equippedModifiers.Clear();
        }
Esempio n. 5
0
        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;
        }
Esempio n. 7
0
    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();
 }
Esempio n. 10
0
 public void Crashing(IFire fire)
 {
     throw new NotImplementedException();
 }
 public void Crashing(IFire fire)
 {
 }
Esempio n. 12
0
 void Start()
 {
     currentWeapon = new Pistol();
 }
Esempio n. 13
0
 private void Start()
 {
     _ammunition = new Bullet(_bullet, 3.0f);
     _weapon     = InitializeDefaultWeapon();
     _fire       = _weapon;
 }