void Update() { float dT = Time.deltaTime; for (int gunIndex = 0; gunIndex < _timeToFire.Count; gunIndex++) { _timeToFire[gunIndex] -= dT; if (_timeToFire[gunIndex] <= 0f) { if (_bulletShooter == null) { _bulletShooter = Directory.Instance.bulletShooter; } if (_weaponData.weapons[gunIndex].playOnFire != null && _weaponData.weapons[gunIndex].playOnFire != "") { Directory.Instance.soundPool.PlaySound(_weaponData.weapons[gunIndex].playOnFire); } _bulletShooter.FireBullet(_weaponData.weapons[gunIndex].bulletToFire, transform.position + _weaponData.weapons[gunIndex].positionOffset, _weaponData.weapons[gunIndex].direction, bulletLayer); _timeToFire[gunIndex] += _weaponData.weapons[gunIndex].timeToFire; } } }
// public void AddShooter(BulletShooter _shooter) { if (this._shooters != null) { this._shooters.Add(_shooter); } }
public static BulletShooter createShooter(chrController chr, SHOT_TYPE type) { BulletShooter bullet_shooter = null; switch (type) { case SHOT_TYPE.EMPTY: { bullet_shooter = chr.gameObject.AddComponent <BulletShooter>(); } break; case SHOT_TYPE.NEGI: { bullet_shooter = chr.gameObject.AddComponent <BulletShooter_negi>(); } break; case SHOT_TYPE.YUZU: { bullet_shooter = chr.gameObject.AddComponent <BulletShooter_yuzu>(); } break; } bullet_shooter.player = chr; return(bullet_shooter); }
private void Start() { base.Start(); _bulletShooter = GetComponent <BulletShooter>(); _rb = GetComponent <Rigidbody2D>(); _platformPathfinding = FindObjectOfType <PlatformPathfinding>(); }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D>(); shooter = GetComponent <BulletShooter>(); if (shooter) { startedOff = !shooter.enabled; } }
void Start() { movement = GetComponent <EnemyLocomotion>(); shooter = GetComponentInChildren <BulletShooter>(); sr = GetComponent <SpriteRenderer>(); soundMod = GetComponent <SoundModulator>(); mainSprite = sr.sprite; }
void Start() { base.Start(); _seeker = GetComponent <Seeker>(); _rigidbody = GetComponent <Rigidbody2D>(); _bulletShooter = GetComponent <BulletShooter>(); Player = FindObjectOfType <PlayerController>().transform; InvokeRepeating("UpdatePath", 0f, 1.2f); }
// SHOT_TYPE을 변경한다. public void changeBulletShooter(SHOT_TYPE shot_type) { if (shot_type != this.shot_type) { if (this.bullet_shooter != null) { GameObject.Destroy(this.bullet_shooter); } this.shot_type = shot_type; this.bullet_shooter = BulletShooter.createShooter(this.control, this.shot_type); } }
void Start() { myNetworkView = GetComponent<NetworkView>(); bulletShooter = GetComponent<BulletShooter>(); }
//-------------------------------------------------- protected virtual void Start() { _rectTransform = this.gameObject.GetComponent <RectTransform>(); _shooter = this.gameObject.GetComponent <BulletShooter>(); }
void Start() { shooter = GetComponent <BulletShooter>(); }
// SHOT_TYPE을 변경한다. public void changeBulletShooter(SHOT_TYPE shot_type) { if(shot_type != this.shot_type) { if(this.bullet_shooter != null) { GameObject.Destroy(this.bullet_shooter); } this.shot_type = shot_type; this.bullet_shooter = BulletShooter.createShooter(this.control, this.shot_type); } }
void Start() { bulletShooter = GetComponentInParent <BulletShooter> (); }
void Start() { BulletShooter = gameObject.GetComponent <BulletShooter> (); }