예제 #1
0
 private void ShootSystem(int laneNum, KeyCode key)
 {
     if (Input.GetKeyDown(key))
     {
         GameObject        bullet = GameObject.Instantiate(_bullet);
         EffectManagerVer2 effect = bullet.GetComponent <EffectManagerVer2>();
         Vector3           pos    = _lanePos[laneNum];
         effect.SetDefaltPos(pos);
     }
 }
예제 #2
0
	void Update () {
        if (player.GetPlayerHp() > 0) Shoot();

        if (firstShooted || createEnemy.GetFirstEnemy() == null) return;
        if (createEnemy.GetFirstEnemy().transform.position.y <= (_lane.GetLaneSizeY() / 3) * 2)
        {
            GameObject bullet = GameObject.Instantiate(_bullet);
            EffectManagerVer2 effect = bullet.GetComponent<EffectManagerVer2>();
            Vector3 pos = _lanePos[createEnemy.GetFirstEnemyPos()];
            effect.SetDefaltPos(pos);
            firstShooted = true;
        }
    }