敵のレーザー攻撃を無効化する防御壁の作成
敵のビーム攻撃の無効化
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyBeam : MonoBehaviour
{
public AudioClip sound;
private void OnTriggerEnter(Collider other)
{
if(other.CompareTag("EnemyBeam"))
{
Destroy(other.gameObject);
AudioSource.PlayClipAtPoint(sound, transform.position);
}
}
}
【2019版】X_Mission(基礎/全51回)
他のコースを見る敵のビーム攻撃の無効化
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyBeam : MonoBehaviour
{
public AudioClip sound;
private void OnTriggerEnter(Collider other)
{
if(other.CompareTag("EnemyBeam"))
{
Destroy(other.gameObject);
AudioSource.PlayClipAtPoint(sound, transform.position);
}
}
}
敵のレーザー攻撃を無効化する防御壁の作成