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); }
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); }
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(); }
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; }
public RpgGun(GameObject gameObject, PoolObjectAmmunition poolObject) : base(gameObject, poolObject) { } //, PoolObjectAmmunition poolObject , poolObject
//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) { }