public Bullet CreateBullet(PoolObjectAmmunition poolObject)
        {
            var bullet     = Resources.Load <AmmunitionBehaviour>("Prefabs/Bullet");
            var gameObject = Object.Instantiate(bullet).gameObject;
            var result     = new Bullet(gameObject, poolObject);

            return(result);
        }
Exemplo n.º 2
0
        public Gun CreateGun(PoolObjectAmmunition poolObject)//
        {
            var gun        = Resources.Load <WeaponBehaviour>("Prefabs/Gun");
            var player     = Object.FindObjectOfType <PlayerBehaviour>();
            var gameObject = Object.Instantiate(gun, player.GunContainer.position, Quaternion.identity,
                                                player.GunContainer).gameObject;

            var result = new Gun(gameObject, poolObject);//

            return(result);
        }
Exemplo n.º 3
0
 protected Weapon(GameObject weaponObject, PoolObjectAmmunition poolObject)
 {
     GameObject       = weaponObject;
     Transform        = weaponObject.transform;
     _weaponBehaviour = GameObject.GetComponent <WeaponBehaviour>();
     _poolObject      = poolObject;
     _timeRemainings  = new HashSet <ITimeRemaining>();
     _timeRemaining   = new TimeRemaining();
     AddTime(_timeRemaining);
     Initialization();
 }
Exemplo n.º 4
0
        protected Ammunition(GameObject bulletObject, PoolObjectAmmunition poolObject)
        {
            _poolObject         = poolObject;
            TimeRemaining       = poolObject.TimeRemaining;
            GameObject          = bulletObject;
            Transform           = GameObject.transform;
            AmmunitionProviders = GameObject.GetComponent <AmmunitionBehaviour>();

            TimeToDestruct = AmmunitionProviders.TimeToDestruct;
            CurDamage      = AmmunitionProviders.CurDamage;
            _contactOffSet = GameObject.GetComponent <Renderer>().bounds.extents.z;
            MaxDistance   += _contactOffSet;
        }
Exemplo n.º 5
0
 public RpgGun(GameObject gameObject, PoolObjectAmmunition poolObject) : base(gameObject, poolObject)
 {
 }                                                                                                       //, PoolObjectAmmunition poolObject , poolObject
Exemplo n.º 6
0
        //private PoolObjectAmmunition _poolObject;

        public Bullet(GameObject gameObject, PoolObjectAmmunition poolObject) : base(gameObject, poolObject)
        {
            _trailRenderer     = gameObject.GetComponentInChildren <TrailRenderer>();
            _timeTrailRenderer = _trailRenderer.time;
            //_poolObject = poolObject;
        }
 public CreateWeapon(Weapon weapon, PoolObjectAmmunition poolObject)
 {
 }