/// <summary>
 /// 敵の死
 /// </summary>
 public void DeathEnemy()
 {
     DeathEffectController.DeathEffect(gameObject.transform.position);
     enemyAudio.DamegeAudio();
     gameObject.SetActive(false);
     //Destroy(gameObject);
     TextController.AddScore();
 }
Exemple #2
0
    /// <summary>
    /// 吸い込み攻撃
    /// </summary>
    /// <param name="direction">1:右 -1:左</param>
    private void Vacuum(int direction)
    {
        float        distance = 2f;
        Vector2      pos      = new Vector2(this.transform.position.x + (direction * distance), transform.position.y);
        RaycastHit2D hit      = Physics2D.Raycast(pos, new Vector2(direction * 1, 0), 1f);

        Debug.DrawLine(this.transform.position, pos, Color.red);
        if (hit.collider == null)
        {
            return;
        }
        if (hit.collider.tag == "Enemy")
        {
            enemyStatus = hit.collider.GetComponent <Enemy>().myEnemyStatus;
            DeathEffectController.DeathEffect(hit.collider.transform.position);
            Destroy(hit.collider.gameObject);
            TextController.AddScore();
            cheekFlag = true;
        }
    }