Example #1
0
    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;
            }
        }
    }
Example #2
0
 //
 public void AddShooter(BulletShooter _shooter)
 {
     if (this._shooters != null)
     {
         this._shooters.Add(_shooter);
     }
 }
Example #3
0
    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);
    }
Example #4
0
 private void Start()
 {
     base.Start();
     _bulletShooter       = GetComponent <BulletShooter>();
     _rb                  = GetComponent <Rigidbody2D>();
     _platformPathfinding = FindObjectOfType <PlatformPathfinding>();
 }
Example #5
0
 // Use this for initialization
 void Start()
 {
     rb      = GetComponent <Rigidbody2D>();
     shooter = GetComponent <BulletShooter>();
     if (shooter)
     {
         startedOff = !shooter.enabled;
     }
 }
Example #6
0
    void Start()
    {
        movement = GetComponent <EnemyLocomotion>();
        shooter  = GetComponentInChildren <BulletShooter>();
        sr       = GetComponent <SpriteRenderer>();
        soundMod = GetComponent <SoundModulator>();

        mainSprite = sr.sprite;
    }
Example #7
0
    void Start()
    {
        base.Start();

        _seeker        = GetComponent <Seeker>();
        _rigidbody     = GetComponent <Rigidbody2D>();
        _bulletShooter = GetComponent <BulletShooter>();

        Player = FindObjectOfType <PlayerController>().transform;

        InvokeRepeating("UpdatePath", 0f, 1.2f);
    }
Example #8
0
    // 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);
        }
    }
Example #9
0
 void Start()
 {
     myNetworkView = GetComponent<NetworkView>();
     bulletShooter = GetComponent<BulletShooter>();
 }
Example #10
0
 //--------------------------------------------------
 protected virtual void Start()
 {
     _rectTransform = this.gameObject.GetComponent <RectTransform>();
     _shooter       = this.gameObject.GetComponent <BulletShooter>();
 }
 void Start()
 {
     shooter = GetComponent <BulletShooter>();
 }
Example #12
0
	// 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);
		}
	}
Example #13
0
 void Start()
 {
     bulletShooter = GetComponentInParent <BulletShooter> ();
 }
Example #14
0
 void Start()
 {
     BulletShooter = gameObject.GetComponent <BulletShooter> ();
 }