ビーム弾のスーパークラスの作成
![Dcb9c0f9 f75a 49fd 8e27 dde118406387](https://codegenius.org/uploads/slide/image/8199/dcb9c0f9-f75a-49fd-8e27-dde118406387.jpeg)
![473f3ae7 73a1 4c36 9a60 f4a2e9add4d3](https://codegenius.org/uploads/slide/image/8200/473f3ae7-73a1-4c36-9a60-f4a2e9add4d3.jpeg)
![E2ce2a9c 1270 4611 9400 abe23f48971e](https://codegenius.org/uploads/slide/image/8201/e2ce2a9c-1270-4611-9400-abe23f48971e.jpeg)
ビーム弾のスーパークラス
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 「abstract」キーワードの追加(復習)
public abstract class BeamBase : MonoBehaviour
{
public AudioClip sound;
// 共通部分のコード
public virtual void OnTriggerEnter(Collider other)
{
Destroy(gameObject);
}
}
![246c98f4 1b8b 43d3 8eb9 9509cb58cac3](https://codegenius.org/uploads/slide/image/8202/246c98f4-1b8b-43d3-8eb9-9509cb58cac3.jpeg)
![71135663 eba1 4490 96a2 962df23f0298](https://codegenius.org/uploads/slide/image/8203/71135663-eba1-4490-96a2-962df23f0298.jpeg)
【2021版】X_Mission(全34回)
他のコースを見る