46. #2スクリプト作成

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BubbleController : MonoBehaviour
{
    // シーンディレクター
    public MergePuzzleSceneDirector SceneDirector;
    // カラー
    public int ColorType;
    // マージ済フラグ
    public bool IsMerged;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        // 画面外に落ちたら消す
        if(transform.position.y < -10)
        {
            Destroy(gameObject);
        }
    }
}
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class MergePuzzleSceneDirector : MonoBehaviour
{
    // アイテムのプレハブ
    [SerializeField] List<BubbleController> prefabBubbles;
    // UI
    [SerializeField] TextMeshProUGUI textScore;
    [SerializeField] GameObject panelResult;
    // Audio
    [SerializeField] AudioClip seDrop;
    [SerializeField] AudioClip seMerge;

    // スコア
    int score;
    // 現在のアイテム
    BubbleController currentBubble;
    // 生成位置
    const float SpawnItemY = 3.5f;
    // Audio再生装置
    AudioSource audioSource;

    // Start is called before the first frame update
    void Start()
    {
        // リザルト画面を非表示
        panelResult.SetActive(false);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}