東方コード

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

public class EnemyTrans : MonoBehaviour
{
    float alfa;
    float alfa2;
    float alfa3=0f;
    float seconds;

    bool a = true;
    // Start is called before the first frame update
    void Start()
    {
        // 現在使用されているマテリアルを取得
        Material mat = this.GetComponent<Renderer>().material;
        // マテリアルの色設定に赤色を設定
        mat.color = new Color(1.0f, 1.0f, 1.0f, 0.1f);
        alfa = 0;
    }

    // Update is called once per frame
    void Update()
    {
        Material mat = this.GetComponent<Renderer>().material;
        // マテリアルの色設定に赤色を設定

        alfa += 0.0035f;
        if (alfa <= 0.9f)
        {
            mat.color = new Color(1.0f, 1.0f, 1.0f, alfa + 0.1f);
        }
        transform.Translate(0f, -0.04f, 0);
        alfa2 += 0.04f;
        if (alfa2>= 8f)
        {
            for(int i=0;i<=100;i++){
            if(a==true){
                    mat.color = new Color(1.0f, 1.0f, 1.0f, 1f);
                    Debug.Log("a");
                    alfa = 0f;
                    a = false;
                    }
                alfa3 += 0.00001f;
                  alfa -= 0.00001f;
                this.transform.localScale = new Vector3(1+alfa3, 1+alfa3, 1);
                mat.color = new Color(1.0f, 1.0f, 1.0f, 1f-alfa);

                if (alfa3>=0.39f){
                this.transform.localScale = new Vector3(1.39f, 1.39f, 1);
                    Time.timeScale = 1.0f;
                    Destroy(this.gameObject);
                   
                }
            }
            alfa3 += 0f;
            
        }
    }
}


using DG.Tweening;
using System;
using UnityEngine;
using UnityEngine.UI;

public class HPGAGE2 : MonoBehaviour
{
    [SerializeField]
    private Image GreenGauge;
    [SerializeField] private Image HPGuard;

    [SerializeField]
    private Image RedGauge;

    private Sakuya player;
    private Tween redGaugeTween;

    private void Start()
    {
        // GreenGauge.color = new Color(1, 1, 1, 0f);
        //  HPGuard.color = new Color(1, 1, 1, 0f);

    }
    private void Update()
    {
        /*if (player.SaHp <= 0)
        {
             GreenGauge.color = new Color(1, 1, 1, 0f);
             HPGuard.color = new Color(1, 1, 1, 0f);

        }*/
    }
    public void GaugeReduction(float reducationValue, float time = 1f)
    {
        var valueFrom = player.SaHp / player.maxLife;
        var valueTo = (player.SaHp - reducationValue) / player.maxLife;
     // 緑ゲージ減少
        GreenGauge.fillAmount = valueTo;

        if (redGaugeTween != null)
        {
            redGaugeTween.Kill();
        }

        // 赤ゲージ減少
        redGaugeTween = DOTween.To(
            () => valueFrom,
            x => {
                RedGauge.fillAmount = x;
            },
            valueTo,
            time + 1.0f
        );
    }

    public void SetPlayer(Sakuya player)
    {
        this.player = player;

    }

    internal void SetPlayer(PlayerManager playerManager)
    {
        throw new NotImplementedException();
    }
}


sing DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

public class HPGAGE3 : MonoBehaviour
{
    [SerializeField]
    private Image GreenGauge;
    [SerializeField] private Image HPGuard;

    [SerializeField]
    private Image RedGauge;

    private Dragon player;
    private Tween redGaugeTween;

    public void GaugeReduction(float reducationValue, float time = 1f)
    {
        var valueFrom = player.hp / player.maxLife;
        var valueTo = (player.hp - reducationValue) / player.maxLife;
        // 緑ゲージ減少
        GreenGauge.fillAmount = valueTo;

        if (redGaugeTween != null)
        {
            redGaugeTween.Kill();
        }

        // 赤ゲージ減少
        redGaugeTween = DOTween.To(
            () => valueFrom,
            x => {
                RedGauge.fillAmount = x;
            },
            valueTo,
            time + 1.0f
        );
    }

    public void SetPlayer(Dragon player)
    {
        this.player = player;

    }
}



using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

public class PlayerGaugeSlider : MonoBehaviour
{
    [SerializeField] private Image GreenGauge;
    [SerializeField] private Image HPGuard;
    [SerializeField] private Image RedGauge;

    private PlayerManager player;
    private Tween redGaugeTween;


    public void GaugeReduction(float reducationValue, float time = 1f)
    {
        var valueFrom = player.hp / player.maxLife;
        var valueTo = (player.hp - reducationValue) / player.maxLife;

        // 緑ゲージ減少
        GreenGauge.fillAmount = valueTo;

        if (redGaugeTween != null)
        {
            redGaugeTween.Kill();
        }

        // 赤ゲージ減少
        redGaugeTween = DOTween.To(
            () => valueFrom,
            x => {
                RedGauge.fillAmount = x;
            },
            valueTo,
            time + 1.0f
        );
    }

    public void SetPlayer(PlayerManager player)
    {
        this.player = player;

    }
}


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

public class Sakuya : Token
{
    public GameObject SakuyaI;
    public GameObject SakuyaI2;
    public GameObject SakuyaI3;
    public GameObject SakuyaI4;
    public GameObject SakuyaI5;
    public GameObject SakuyaI6;

    public GameManager gamemanager;
    protected HPGAGE2 playerGauge2;
    public YsShot3 raku;
    int zanku;
    int zanku2;
    float Del1;
    float Del2;
    float Del3;
    float Del4;
    float Del5;
    float Del6;
    float Del7;
    float Del8;
    float dir;
    float dir2;
    float dir3;
    [SerializeField] AudioClip DamageSE;
    [SerializeField] AudioClip DeathSE;
    [SerializeField] AudioClip KnifeSE;
    [SerializeField] AudioClip SakuyaSE;
    GameObject player;
    //二点間の距離を入れる
    private float distance_two;
    private float distance_two2;
    private float distance_two3;
    private float distance_two4;
    private float distance_two5;
    private float distance_two6;
    private float distance_two7;
    public int SaHp;
    //狙い撃ちするターゲット
    public static PlayerManager target = null;
    Animator animator;

    public GameObject BlSh;
    public GameObject BlKn;
    public GameObject BlKn2;
    public GameObject BlKn3;
    public GameObject BlKn4;
    public GameObject PlKn;
    public GameObject Illust;
    public Transform SakuPo0;
    public Transform SakuPo;
    public Transform SakuPo2;
    public Transform SakuPo3;
    public Transform SakuPo4;
    public Transform SakuPo5;
    public Transform SakuPo6;
    public Transform SakuPo7;
    public Transform PlayPo;
    float SakuT1;
    float SakuT2;
    float timer1;
    public float maxLife;

    //    bool eit = false;
    bool eit2 = false;
    bool eit3 = false;
    bool eit4 = false;
    bool eit5 = false;
    bool eit6 = false;
    bool eit7 = false;


    bool dist = false;
    bool Hiro = true;
    public float GetAim()
    {
        float dx = target.X - X;
        float dy = target.Y - Y;
        return Mathf.Atan2(dy, dx) * Mathf.Rad2Deg;
    }
    public float GetAim2()
    {
        float dx = target.X - (target.X + Del1);
        float dy = target.Y - (target.Y + Del2);
        return Mathf.Atan2(dy, dx) * Mathf.Rad2Deg;
    }
    public float GetAim3()
    {
        float dx = target.X - (target.X - Del1);
        float dy = target.Y - (target.Y - Del2);
        return Mathf.Atan2(dy, dx) * Mathf.Rad2Deg;
    }
    // Start is called before the first frame update
    void Start()
    {
        playerGauge2 = GameObject.FindObjectOfType<HPGAGE2>();
        playerGauge2.SetPlayer(this);
        maxLife = 400;
        timer1 = 0.008f;
        distance_two2 = Vector3.Distance(SakuPo0.position, SakuPo2.position);
        distance_two3 = Vector3.Distance(SakuPo0.position, SakuPo3.position);
        distance_two4 = Vector3.Distance(SakuPo0.position, SakuPo4.position);
        distance_two5 = Vector3.Distance(SakuPo0.position, SakuPo5.position);
        distance_two6 = Vector3.Distance(SakuPo0.position, SakuPo6.position);
        distance_two7 = Vector3.Distance(SakuPo0.position, SakuPo7.position);
        // distance_two3 = Vector3.Distance(SakuPo0.position, SakuPo.position);

        eit2 = false;
        // 現在使用されているマテリアルを取_得
        Material mat = this.GetComponent<Renderer>().material;
        // マテリアルの色設定に赤色を設定
        mat.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);

        SaHp = 400;
        animator = GetComponent<Animator>();
        StartCoroutine("_Update1");
    }


    // Update is called once per frame
    void Update()
    {
        transform.Translate(SakuT1, SakuT2, 0);
        // 現在の位置
        float present_Location2 = (Time.time * timer1) / distance_two2;
        float present_Location3 = (Time.time * timer1) / distance_two3;
        float present_Location4 = (Time.time * timer1) / distance_two4;
        float present_Location5 = (Time.time * timer1) / distance_two5;
        float present_Location6 = (Time.time * timer1) / distance_two6;
        float present_Location7 = (Time.time * timer1) / distance_two7;

        //Debug.Log("spd2="+Vector3 );
        if (eit2)
        {
            transform.position = Vector3.Lerp(SakuPo0.position, SakuPo2.position, present_Location2);
        }
        if (eit3)
        {
            transform.position = Vector3.Lerp(SakuPo0.position, SakuPo3.position, present_Location3);
        }
        if (eit4)
        {
            transform.position = Vector3.Lerp(SakuPo0.position, SakuPo4.position, present_Location4);
        }
        if (eit5)
        {
            transform.position = Vector3.Lerp(SakuPo0.position, SakuPo5.position, present_Location5);
        }
        if (eit6)
        {
            transform.position = Vector3.Lerp(SakuPo0.position, SakuPo6.position, present_Location6);
        }
        if (eit7)
        {
            transform.position = Vector3.Lerp(SakuPo0.position, SakuPo7.position, present_Location7);
        }
    }
    public void OnDamage(int damage)
    {
        playerGauge2.GaugeReduction(damage);
        StartCoroutine("ColorChance");
        SaHp -= damage;
        var audioS = FindObjectOfType<AudioSource>();
        audioS.PlayOneShot(DamageSE);

        //animator.SetTrigger("IsHurt");
        if (SaHp <= 0)
        {
            Die();
        }
    }
    void Die()
    {
        var audioS = FindObjectOfType<AudioSource>();
        //        audioS.PlayOneShot(DeathSE);
        audioS.PlayOneShot(DeathSE);

        for (int i = 0; i < 32; i++)
        {
            Particle.Add(X, Y);

        }
        gamemanager.GameClear();
        DestroyObj();
    }
    IEnumerator _Update1()
    {

        while (true)
        {

            //2秒置きに弾を撃つ
            yield return new WaitForSeconds(1.55f);
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.45f);
            var audioS = FindObjectOfType<AudioSource>();
            audioS.PlayOneShot(KnifeSE);
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 7));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 5));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 2.5f));
            //  audioS.PlayOneShot(RemiriaSE);

            if (SaHp <= 90 * 4)
            {
                yield return StartCoroutine("_Update2");
                break;
            }

        }
    }
    IEnumerator ColorChance()
    {
        Material dragond = this.GetComponent<Renderer>().material;
        dragond.color = new Color(1.0f, 1.0f, 1.0f, 0.5f);

        yield return new WaitForSeconds(0.1f);
        dragond.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);


    }
    IEnumerator _Update2()
    {
        SaHp = 360;
        animator.SetTrigger("Jump");
        SaHp = 360;
        yield return new WaitForSeconds(0.7f);
        SaHp = 360;
        //        SakuT1 = 0.01f;SakuT2 = 0.03f;
        eit2 = true;
        yield return new WaitForSeconds(0.7f);
        SaHp = 360;
        animator.SetTrigger("Def");
        transform.rotation = Quaternion.Euler(0, 0, 90);
        eit2 = false;
        eit3 = true;
        timer1 = 0.006f;
        //        SakuT1 = 0f;
        // SakuT2 = 0.03f;
        var audioS = FindObjectOfType<AudioSource>();
        audioS.PlayOneShot(KnifeSE);
        for (int i = 0; i < 11; i++)
        {
            animator.SetTrigger("Knife1");

            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 95));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 90));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 85f));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 80f));
            yield return new WaitForSeconds(0.4f);
        }
          yield return new WaitForSeconds(0.8f);
        eit3 = false;
        eit5 = true;
        timer1 = 0.08f;
        transform.rotation = Quaternion.Euler(0, 0, 0);
        transform.localScale = new Vector3(-1, 1, 1);
        //SakuT2 = -0.027f;
        yield return new WaitForSeconds(0.8f);
        //SakuT2 = 0;
        eit5 = false;


        while (true)
        {
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.45f);
            audioS.PlayOneShot(KnifeSE);
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 173));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 175));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 177.5f));
            if (SaHp <= 80 * 4)
            {
                eit5 = false;
                yield return StartCoroutine("_Update3");
                break;
            }
        }
    }
    IEnumerator _Update3()
    {
        SaHp = 320;
        timer1 = 0.01f;
        animator.SetTrigger("Jump");
        yield return new WaitForSeconds(0.7f);
        SakuT1 = -0.01f;
        SakuT2 = 0.03f;
        SaHp = 320;
        yield return new WaitForSeconds(0.7f);
        animator.SetTrigger("Def");
        SakuT1 = 0f;
        SakuT2 = 0f;
        SaHp = 320;
        animator.SetTrigger("Knife2");
        var audioS = FindObjectOfType<AudioSource>();
        audioS.PlayOneShot(KnifeSE);
        eit3 = true;
        for (int i = 0; i < 110; i++)
        {
            int ran = Random.Range(90, 180);
            Instantiate(PlKn, SakuPo.position, Quaternion.Euler(0f, 0f, ran));
            Instantiate(PlKn, SakuPo.position, Quaternion.Euler(0f, 0f, ran));
            Instantiate(PlKn, SakuPo.position, Quaternion.Euler(0f, 0f, ran));
            Instantiate(PlKn, SakuPo.position, Quaternion.Euler(0f, 0f, ran));
            Instantiate(PlKn, SakuPo.position, Quaternion.Euler(0f, 0f, ran));

            yield return new WaitForSeconds(0.01f);
        }
        //timer1 = 1f;
        eit5 = false;

        while (true)
        {
            if (SaHp <= 70 * 4)
            {
                dist = true;
                SaHp = 280;
                eit3 = false;
                eit4 = false;
                eit5 = false;
                eit6 = false;
                yield return StartCoroutine("_Update4");
                break;
            }
            animator.SetTrigger("Knife1");
            transform.localScale = new Vector3(-1, 1, 1);
            yield return new WaitForSeconds(0.4f);
            if (SaHp <= 70 * 4)
            {
                eit3 = false;
                dist = true;
                SaHp = 280;
                eit4 = false;
                eit5 = false;
                eit6 = false;
                yield return StartCoroutine("_Update4");
                break;
            }

            eit3 = false;
            audioS.PlayOneShot(KnifeSE);
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 165));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 170));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 173));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 175));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 177.5f));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 180));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 185));

            yield return new WaitForSeconds(2f);

            eit4 = true;
            yield return new WaitForSeconds(0.1f);

            dir = GetAim();
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.4f);

            YsShot4.Add(X, Y, dir, 4);
            yield return new WaitForSeconds(1f);

            eit4 = false;
            eit6 = true;
            animator.SetTrigger("Knife1");
            transform.localScale = new Vector3(1, 1, 1);
            yield return new WaitForSeconds(0.4f);
            if (SaHp <= 70 * 4)
            {
                eit3 = false;
                dist = false;
                SaHp = 280;
                eit4 = false;
                eit5 = false;
                eit6 = false;
                yield return StartCoroutine("_Update4");
                break;
            }
            audioS.PlayOneShot(KnifeSE);
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 165 - 170));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 170 - 170));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 173 - 170));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 175 - 170));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 177.5f - 170));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 180 - 170));
            Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 185 - 170));
            yield return new WaitForSeconds(2f);
            if (SaHp <= 70 * 4)
            {
                eit3 = false;
                dist = false;
                SaHp = 280;
                eit4 = false;
                eit5 = false;
                eit6 = false;
                yield return StartCoroutine("_Update4");
                break;
            }
            eit6 = false;
            eit4 = true;
            yield return new WaitForSeconds(0.1f);

            dir = GetAim();
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.4f);

            YsShot4.Add(X, Y, dir, 4);
            yield return new WaitForSeconds(1f);
            eit4 = false;
            eit5 = true;
        }
    }
    IEnumerator _Update4()
    {
        float saru = 0;
        SaHp = 280;
        timer1 = 0.001f;
        while (true)
        {
            saru = 0;
            if (SaHp <= 40 * 4)
            {
                eit5 = false;
                eit6 = false;

                dist = false;
                SaHp = 160;
                eit4 = true;
                yield return StartCoroutine("_Update5");
                break;
            }
            if (dist == true)
            {
                if (zanku >= 5)
                {
                    zanku = 0;
                }
                zanku++;
            }
            else
            {
                if (zanku2 >= 5)
                {
                    zanku2 = 0;
                }
                zanku2++;
            }


            yield return new WaitForSeconds(1.5f);
            if (SaHp <= 40 * 4)
            {
                eit5 = false;
                eit6 = false;

                dist = false;
                SaHp = 160;
                eit4 = true;
                yield return StartCoroutine("_Update5");
                break;
            }
            animator.SetTrigger("SakuyaAction");
            var audioS = FindObjectOfType<AudioSource>();
            audioS.PlayOneShot(KnifeSE);

            for (int s = 0; s < 4; s++)
            {

                for (int i = 0; i < 32; i++)
                {
                    if (SaHp <= 240)
                    {
                        Instantiate(BlSh, SakuPo.position, Quaternion.Euler(0f, 0f, 0 + saru));
                        saru += 11.25f;
                    }
                }
                yield return new WaitForSeconds(0.2f);
                if (SaHp <= 40 * 4)
                {
                    eit5 = false;
                    eit6 = false;

                    dist = false;
                    SaHp = 160;
                    eit4 = true;
                    yield return StartCoroutine("_Update5");
                    break;
                }

                if (s == 2)
                {

                }
            }
            Vector3 ill2 = new Vector3(Del1, Del2, 0f);
            Vector3 ill3 = new Vector3(Del3, Del4, 0f);
            Vector3 ill4 = new Vector3(Del5, Del6, 0f);
            Vector3 ill5 = new Vector3(Del7, Del8, 0f);

            Time.timeScale = 0.0001f;
            switch (zanku)
            {
                case 1:
                    eit5 = false;
                    eit6 = false;
                    eit4 = true;
                    break;
                case 2:
                    eit5 = false;
                    eit4 = false;
                    eit6 = true;
                    transform.localScale = new Vector3(1, 1, 1);
                    break;
                case 3:
                    eit5 = false;
                    eit6 = false;
                    eit4 = true;

                    break;
                case 4:
                    eit6 = false;
                    eit4 = false;
                    eit5 = true;

                    transform.localScale = new Vector3(-1, 1, 1);
                    break;

            }
            switch (zanku2)
            {
                case 1:
                    eit5 = false;
                    eit6 = false;
                    eit4 = true;
                    break;
                case 2:
                    eit4 = false;
                    eit6 = false;
                    eit5 = true;
                    transform.localScale = new Vector3(-1, 1, 1);
                    break;
                case 3:
                    eit5 = false;
                    eit6 = false;
                    eit4 = true;
                    break;
                case 4:
                    eit4 = false;
                    eit5 = false;
                    eit6 = true;
                    transform.localScale = new Vector3(1, 1, 1);
                    break;

            }
            player = GameObject.Find("ZOMBI");
            Del1 = 3; Del3 = -2;
            Del5 = 3; Del7 = -2;
            raku.Plus(-3);
            if (SaHp >= 240 || SaHp <= 200)
            {

                for (int s = 0; s < 5; s++)
                {
                    Time.timeScale = 0.0001f;
                    Del2 = 4; Del4 = 0.5f;
                    audioS.PlayOneShot(KnifeSE);

                    for (int i = 0; i < 7; i++)
                    {

                        dir = GetAim2();
                        ill2 = new Vector3(Del1, Del2, 0f);
                        Instantiate(BlKn, player.transform.position + ill2, Quaternion.Euler(0f, 0f, dir - 180));
                        ill3 = new Vector3(Del3, Del4, 0f);
                        Instantiate(BlKn, player.transform.position + ill2 + ill3, Quaternion.Euler(0f, 0f, dir - 220));


                        Del2--; Del4--;
                    }
                    audioS.PlayOneShot(KnifeSE);

                    for (int i = 0; i < 2; i++)
                    {
                        ill2 = new Vector3(Del1, Del2, 0f);
                        ill3 = new Vector3(Del3, Del4, 0f);
                        Instantiate(BlKn, player.transform.position + ill2 + ill3, Quaternion.Euler(0f, 0f, dir - 220));
                        Del2--; Del4--;
                    }
                    Del1++; Del3++;
                    yield return new WaitForSeconds(0.00001f);
                    Time.timeScale = 0.99f;

                }
            }
            if (SaHp < 240)
            {
                for (int s = 0; s < 5; s++)
                {
                    Time.timeScale = 0.0001f;
                    Del2 = 4; Del4 = 0.5f;
                    audioS.PlayOneShot(KnifeSE);

                    for (int i = 0; i < 7; i++)
                    {
                        dir = GetAim3();
                        ill2 = new Vector3(Del1, Del2, 0f);
                        Instantiate(BlKn, player.transform.position - ill2, Quaternion.Euler(0f, 0f, dir - 180));
                        ill3 = new Vector3(Del3, Del4, 0f);
                        Instantiate(BlKn, player.transform.position - ill2 - ill3, Quaternion.Euler(0f, 0f, dir - 220));


                        Del2--; Del4--;
                    }
                    audioS.PlayOneShot(KnifeSE);

                    for (int i = 0; i < 2; i++)
                    {
                        ill2 = new Vector3(Del1, Del2, 0f);
                        ill3 = new Vector3(Del3, Del4, 0f);
                        Instantiate(BlKn, player.transform.position - ill2 - ill3, Quaternion.Euler(0f, 0f, dir - 220));
                        Del2--; Del4--;
                    }
                    Del1++; Del3++;
                    yield return new WaitForSeconds(0.00001f);
                    Time.timeScale = 0.99f;

                }
            }


            yield return new WaitForSeconds(0.02f);

            Time.timeScale = 0.0001f;
            yield return new WaitForSeconds(0.0002f);
            Time.timeScale = 1;
            if (SaHp <= 40 * 4)
            {
                eit5 = false;
                eit6 = false;

                dist = false;
                SaHp = 160;
                eit4 = true;
                yield return StartCoroutine("_Update5");
                break;
            }

            SakuT1 = 0; SakuT2 = 0f;
            yield return new WaitForSeconds(2f);
        }
    }
    IEnumerator _Update5()
    {
        SaHp = 160;
        timer1 = 0.02f;
        int ran2;
        //        yield return new WaitForSeconds(0.2f);
        animator.SetTrigger("SakuyaTired");
        for (int i = 0; i < 13; i++)
        {
            SakuT2 = 0.006f;
            yield return new WaitForSeconds(0.25f);
            SakuT2 = -0.006f;
            yield return new WaitForSeconds(0.25f);
        }
        eit4 = false;
        SakuT2 = 0f;
        animator.SetTrigger("Def");
        SaHp = 160;
        while (true)
        {
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.45f);
            if (SaHp <= 120)
            {
                animator.SetTrigger("Knife1");
            }
            yield return new WaitForSeconds(0.2f);
            if (SaHp <= 120)
            {
                animator.SetTrigger("Knife1");
            }
            yield return new WaitForSeconds(0.2f);
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            eit4 = false;
            if (SaHp <= 80)
            {
                Instantiate(SakuyaI, transform.position, Quaternion.Euler(0f, 0f, 20));
                Instantiate(SakuyaI2, transform.position, Quaternion.Euler(0f, 0f, 40));
                Instantiate(SakuyaI3, transform.position, Quaternion.Euler(0f, 0f, 160));
                Instantiate(SakuyaI4, transform.position, Quaternion.Euler(0f, 0f, 140));
            }
            var audioS = FindObjectOfType<AudioSource>();
            audioS.PlayOneShot(KnifeSE);

            for (int i = 0; i <= 70; i++)
            {
                ran2 = Random.Range(180, 360);
                Instantiate(BlKn2, SakuPo0.position, Quaternion.Euler(0f, 0f, ran2));
            }
            audioS.PlayOneShot(KnifeSE);

            for (int i = 0; i <= 70; i++)
            {
                ran2 = Random.Range(0, 180);
                Instantiate(BlKn2, SakuPo0.position, Quaternion.Euler(0f, 0f, ran2));
            }
            yield return new WaitForSeconds(0.2f);
            if (SaHp <= 120)
            {
                audioS.PlayOneShot(KnifeSE);

                for (int i = 0; i <= 70; i++)
                {
                    ran2 = Random.Range(180, 360);
                    Instantiate(BlKn2, SakuPo0.position, Quaternion.Euler(0f, 0f, ran2));
                }
                audioS.PlayOneShot(KnifeSE);

                for (int i = 0; i <= 70; i++)
                {
                    ran2 = Random.Range(0, 180);
                    Instantiate(BlKn2, SakuPo0.position, Quaternion.Euler(0f, 0f, ran2));
                }
            }
            yield return new WaitForSeconds(0.2f);
            if (SaHp <= 120)
            {
                audioS.PlayOneShot(KnifeSE);

                for (int i = 0; i <= 70; i++)
                {
                    ran2 = Random.Range(180, 360);
                    Instantiate(BlKn2, SakuPo0.position, Quaternion.Euler(0f, 0f, ran2));
                }
                audioS.PlayOneShot(KnifeSE);

                for (int i = 0; i <= 70; i++)
                {
                    ran2 = Random.Range(0, 180);
                    Instantiate(BlKn2, SakuPo0.position, Quaternion.Euler(0f, 0f, ran2));
                }
            }
            yield return new WaitForSeconds(0.5f);
            animator.SetTrigger("Knife2");
            yield return new WaitForSeconds(1.0998f);
            Time.timeScale = 0.0001f;
            yield return new WaitForSeconds(0.0002f);
            Time.timeScale = 1f;
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            eit5 = true;
            transform.localScale = new Vector3(-1, 1, 1);
            yield return new WaitForSeconds(2f);
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.25f);
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.2f);
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            dir = GetAim();
            audioS.PlayOneShot(KnifeSE);

            for (float i = 0; i < 4; i += 1)
            {
                YsShot4.Add(X, Y + (i - 0.99f), dir, 6);
                if (SaHp <= 120)
                {
                    yield return new WaitForSeconds(0.2f);
                    audioS.PlayOneShot(KnifeSE);
                    YsShot4.Add(X, Y + (i - 0.99f), dir, 8);

                }
            }
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            eit5 = false;
            yield return new WaitForSeconds(0.5f);
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            eit6 = true;
            transform.localScale = new Vector3(1, 1, 1);

            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.25f);
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.2f);
            dir = GetAim();
            audioS.PlayOneShot(KnifeSE);

            for (float i = 0; i < 4; i += 1)
            {
                YsShot4.Add(X, Y + (i - 0.99f), dir, 8);
                if (SaHp <= 120)
                {
                    audioS.PlayOneShot(KnifeSE);
                    yield return new WaitForSeconds(0.2f);
                    YsShot4.Add(X, Y + (i - 0.99f), dir, 10);
                }
            }
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            yield return new WaitForSeconds(3f);
            if (SaHp <= 10 * 4)
            {
                SaHp = 40;
                eit5 = false;
                eit6 = false;
                eit4 = true;
                yield return StartCoroutine("_Update6");
                break;
            }
            eit6 = false;
            eit4 = true;
        }
    }
    IEnumerator _Update6()
    {
        SaHp = 40;
        timer1 = 0.02f;
        float ran = 0;
        float ran2 = 0;
        animator.SetTrigger("SakuyaTired");
        for (int i = 0; i < 13; i++)
        {
            SakuT2 = 0.006f;
            yield return new WaitForSeconds(0.25f);
            SakuT2 = -0.006f;
            yield return new WaitForSeconds(0.25f);
        }
        eit4 = false;
        SakuT2 = 0f;
        animator.SetTrigger("Def");
        SaHp = 4000;

        Vector3 ill5 = new Vector3(0f, 8f, 0f);
        var audioS = FindObjectOfType<AudioSource>();
        for (int i = 0; i < 5; i++)
        {
            audioS.PlayOneShot(SakuyaSE);
        }
        Instantiate(Illust, PlayPo.position + ill5, Quaternion.Euler(0f, 0f, 0));
        // Time.timeScale = 0f;
        yield return new WaitForSeconds(1f);
        while (true)
        {
            eit5 = true;
            transform.localScale = new Vector3(-1, 1, 1);
            yield return new WaitForSeconds(1f);
            eit5 = false;
            audioS.PlayOneShot(KnifeSE);

            for (int i = 0; i <= 20; i++)
            {
                animator.SetTrigger("Knife1");
                yield return new WaitForSeconds(0.25f);
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 180));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 175));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 185));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 190));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 170));
            }
            eit6 = true;
            transform.localScale = new Vector3(1, 1, 1);
            yield return new WaitForSeconds(1f);
            eit6 = false;
            audioS.PlayOneShot(KnifeSE);

            for (int i = 0; i <= 20; i++)
            {
                animator.SetTrigger("Knife1");
                yield return new WaitForSeconds(0.25f);
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 0));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 15));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 20));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 5));
                Instantiate(BlKn, SakuPo.position, Quaternion.Euler(0f, 0f, 10));
                //         eit6 = false;
            }
            yield return new WaitForSeconds(1f);
            SakuT2 = 0.006f;
            audioS.PlayOneShot(KnifeSE);

            for (int i = 0; i < 15; i++)
            {
                animator.SetTrigger("Knife1");
                yield return new WaitForSeconds(0.45f);
                dir = GetAim();
                YsShot4.Add(X, Y, dir, 6);
                YsShot4.Add(X, Y + 1, dir, 6);
                YsShot4.Add(X, Y - 1, dir, 6);
                YsShot4.Add(X, Y + 2, dir, 6);
                YsShot4.Add(X, Y - 2, dir, 6);
                YsShot4.Add(X, Y - 4, dir, 6);
                YsShot4.Add(X, Y + 4, dir, 6);
            }
            SakuT2 = 0;
            eit5 = true;
            transform.localScale = new Vector3(-1, 1, 1);
            yield return new WaitForSeconds(1f);

            eit5 = false;
            SakuT2 = 0.006f;
            animator.SetTrigger("Knife1");
            audioS.PlayOneShot(KnifeSE);
            for (int i = 0; i < 15; i++)
            {
                animator.SetTrigger("Knife1");
                yield return new WaitForSeconds(0.45f);
                dir = GetAim();
                YsShot4.Add(X, Y, dir, 8);
                YsShot4.Add(X, Y + 1, dir, 8);
                YsShot4.Add(X, Y - 1, dir, 8);
                YsShot4.Add(X, Y + 2, dir, 8);
                YsShot4.Add(X, Y - 2, dir, 8);
                YsShot4.Add(X, Y + 4, dir, 8);
                YsShot4.Add(X, Y - 4, dir, 8);

            }
            SakuT2 = 0;
            eit4 = true;
            yield return new WaitForSeconds(1f);
            eit4 = false;
            animator.SetTrigger("Knife2");
            yield return new WaitForSeconds(0.45f);
            for (int i = 0; i <= 10; i++)
            {
                Debug.Log("s");
                audioS.PlayOneShot(KnifeSE);

                for (int s = 0; s < 10; s++)
                {
                    ran = Random.Range(150f, 390f);
                    Instantiate(BlKn3, SakuPo.position, Quaternion.Euler(0f, 0f, ran));
                }
                yield return new WaitForSeconds(0.1f);
            }
            yield return new WaitForSeconds(1.047f);
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.45f);
            Time.timeScale = 0.001f;
            yield return new WaitForSeconds(0.003f);

            Time.timeScale = 1f;
            yield return new WaitForSeconds(3f);


            animator.SetTrigger("Knife2");
            yield return new WaitForSeconds(0.45f);
            for (int i = 0; i <= 10; i++)
            {
                audioS.PlayOneShot(KnifeSE);

                Debug.Log("s");
                for (int s = 0; s < 10; s++)
                {
                    ran = Random.Range(150f, 390f);
                    Instantiate(BlKn3, SakuPo.position, Quaternion.Euler(0f, 0f, ran));
                }
                yield return new WaitForSeconds(0.1f);
            }
            audioS.PlayOneShot(KnifeSE);
            Instantiate(SakuyaI5, transform.position, Quaternion.Euler(0f, 0f, 20));
            Instantiate(SakuyaI5, transform.position, Quaternion.Euler(0f, 0f, 40));
            Instantiate(SakuyaI5, transform.position, Quaternion.Euler(0f, 0f, 160));
            Instantiate(SakuyaI5, transform.position, Quaternion.Euler(0f, 0f, 140));

             yield return new WaitForSeconds(1.047f);
            animator.SetTrigger("Knife1");
            yield return new WaitForSeconds(0.45f);
            Time.timeScale = 0.001f;
            yield return new WaitForSeconds(0.003f);

            Time.timeScale = 1f;
            yield return new WaitForSeconds(8f);

            for (int i = 0; i <= 10; i++)
            {
                animator.SetTrigger("Knife1");
                yield return new WaitForSeconds(0.45f);
                audioS.PlayOneShot(KnifeSE);

                for (int s = 0; s < 10; s++)
                {
                    ran2 = Random.Range(150f, 390f);
                    Instantiate(BlKn4, SakuPo.position, Quaternion.Euler(0f, 0f, ran2));
                }
            }
            yield return new WaitForSeconds(6f);
            for (int i = 0; i <= 10; i++)
            {
                animator.SetTrigger("Knife1");
                yield return new WaitForSeconds(0.45f);
                audioS.PlayOneShot(KnifeSE);

                for (int s = 0; s < 10; s++)
                {
                    ran2 = Random.Range(150f, 390f);
                    Instantiate(BlKn4, SakuPo.position, Quaternion.Euler(0f, 0f, ran2));
                }
            }
            audioS.PlayOneShot(KnifeSE);
            Instantiate(SakuyaI6, transform.position, Quaternion.Euler(0f, 0f, 20));
            Instantiate(SakuyaI6, transform.position, Quaternion.Euler(0f, 0f, 40));
            Instantiate(SakuyaI6, transform.position, Quaternion.Euler(0f, 0f, 160));
            Instantiate(SakuyaI6, transform.position, Quaternion.Euler(0f, 0f, 140));

            yield return new WaitForSeconds(11f);
            eit7 = true;
            SaHp = 40;
            animator.SetTrigger("SakuyaTired");
            for (int i = 0; i < 20; i++)
            {
                SakuT2 = 0.006f;
                yield return new WaitForSeconds(0.25f);
                SakuT2 = -0.006f;
                yield return new WaitForSeconds(0.25f);
            }
            yield return new WaitForSeconds(11f);
            animator.SetTrigger("Def");
            eit7 = false;
        }
    }
}


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

public class SakuyaCircle : MonoBehaviour
{
    public GameObject shot1;
    public GameObject shot2;
    public GameObject shot3;
    public GameObject shot4;
    public GameObject shot5;
    public GameObject shot6;
    private Sakuya player;
    Rigidbody2D rb;
    int up;


    public enum Part
    {
        Pattern1,
        Pattern2,
        Pattern3,
        Pattern4,
        Pattern5,
        Pattern6
    }
    //enumを変数として宣言する
    //public変数なのでInspectorで指定可能
    public Part part;
    // Start is called before the first frame update
    void Start()
    {
        switch (part)
        {
            case Part.Pattern1:
                StartCoroutine("_Update1");
                break;
            case Part.Pattern2:
                StartCoroutine("_Update2");
                break;
            case Part.Pattern3:
                StartCoroutine("_Update3");
                break;
            case Part.Pattern4:
                StartCoroutine("_Update4");
                break;
            case Part.Pattern5:
                StartCoroutine("_Update5");
                break; 
                case Part.Pattern6:
                StartCoroutine("_Update6");
                break;
        }
        rb = GetComponent<Rigidbody2D>();
        rb.velocity = transform.right * 0.7f;
        Invoke("OnDestroy", 6f);

    }
    // Update is called once per frame
    void Update()
    {
    }
    private void OnDestroy()
    {
        Destroy(gameObject);
    }
    IEnumerator _Update1()
    {
        while (true)
        {
            Instantiate(shot1, transform.position, Quaternion.Euler(0f, 0f, up));
            Instantiate(shot1, transform.position, Quaternion.Euler(0f, 0f, up + 1));
            Instantiate(shot1, transform.position, Quaternion.Euler(0f, 0f, up + 2));
            Instantiate(shot1, transform.position, Quaternion.Euler(0f, 0f, up + 3));
            Instantiate(shot1, transform.position, Quaternion.Euler(0f, 0f, up + 4));

            up += 36;
            yield return new WaitForSeconds(0.15f);
        }
    }
    IEnumerator _Update2()
    {
        while (true)
        {
            Instantiate(shot2, transform.position, Quaternion.Euler(0f, 0f, -up));
            Instantiate(shot2, transform.position, Quaternion.Euler(0f, 0f, -up - 1));
            Instantiate(shot2, transform.position, Quaternion.Euler(0f, 0f, -up - 2));
            Instantiate(shot2, transform.position, Quaternion.Euler(0f, 0f, -up - 3));
            Instantiate(shot2, transform.position, Quaternion.Euler(0f, 0f, -up - 4));

            up += 36;
            yield return new WaitForSeconds(0.3f);
        }
    }
    IEnumerator _Update3()
    {
        while (true)
        {
            Instantiate(shot3, transform.position, Quaternion.Euler(0f, 0f, -up));
            Instantiate(shot3, transform.position, Quaternion.Euler(0f, 0f, -up + 2f));
            Instantiate(shot3, transform.position, Quaternion.Euler(0f, 0f, -up + 4));
            Instantiate(shot3, transform.position, Quaternion.Euler(0f, 0f, -up + 6f));
            Instantiate(shot3, transform.position, Quaternion.Euler(0f, 0f, -up + 8f));
            Instantiate(shot3, transform.position, Quaternion.Euler(0f, 0f, -up + 10f));
            up -= 36;
            yield return new WaitForSeconds(0.3f);
        }
    }
    IEnumerator _Update4()
    {
        while (true)
        {
            Instantiate(shot4, transform.position, Quaternion.Euler(0f, 0f, -up));
            Instantiate(shot4, transform.position, Quaternion.Euler(0f, 0f, -up + 2f));
            Instantiate(shot4, transform.position, Quaternion.Euler(0f, 0f, -up + 4));
            Instantiate(shot4, transform.position, Quaternion.Euler(0f, 0f, -up + 6));
            Instantiate(shot4, transform.position, Quaternion.Euler(0f, 0f, -up + 8));
            Instantiate(shot4, transform.position, Quaternion.Euler(0f, 0f, -up + 10));
            up += 36;
            yield return new WaitForSeconds(0.3f);
        }
    }
    IEnumerator _Update5()
    {
        float ran=0f;
        while (true)
        {
            ran = Random.Range(150f, 390f);
            Instantiate(shot5, transform.position, Quaternion.Euler(0f, 0f, ran));
            Instantiate(shot5, transform.position, Quaternion.Euler(0f, 0f, ran));
            Instantiate(shot5, transform.position, Quaternion.Euler(0f, 0f, ran));

            up += 36;
            yield return new WaitForSeconds(0.3f);
        }
    }  
    IEnumerator _Update6()
    {
        float ran2=0f;
        while (true)
        {
            for (int i = 0; i < 6; i++)
            {
                ran2 = Random.Range(150f, 390f);
                Instantiate(shot6, transform.position, Quaternion.Euler(0f, 0f, ran2));
            }

            up += 36;
            yield return new WaitForSeconds(0.3f);
        }
    }
}


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

public class YsShot4 : Token
{
    Rigidbody2D rb;
    GameManager gameManager;
    public static DragonShot instance;
    private Vector3 m_velocity; //速度
    public float speed = -6;
    public float spd;
    //敵弾管理
    public static TokenMgr<YsShot4> parent = null;
    public static YsShot4 Add(float x, float y, float direction, float speed)
    {
        return parent.Add(x, y, direction, speed);
    }
    void Start()
    {
        Destroy(gameObject, 8f);
    }
    /*public void Velos(float spd){
        speed = spd;
    }*/
    private void FixedUpdate()
    {
        Angle = Direction - 90f;
    }
    public void SPd(float speed)
    {
        rb.velocity = transform.right * speed;

    }
    public void Plus(float spd)
    {
        speed = spd;
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "hitJudge")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "YoumuSpell")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "Player")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "Block")
        {
            Destroy(gameObject);
        }
        if (collision.gameObject.tag == "Zangeki")
        {
            Destroy(gameObject);
        }

    }

    IEnumerator _Medate1()
    {
        //2秒置きに弾を撃つ
        yield return new WaitForSeconds(0.1f);
     }
}



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

public class YsShot5 : Token
{
    public GameObject st;
    Rigidbody2D rb;
    GameManager gameManager;
    public static DragonShot instance;
    private Vector3 m_velocity; //速度
    public float speed = -6;
    public float spd;
    //敵弾管理
    public static TokenMgr<YsShot3> parent = null;
    public static YsShot3 Add(float x, float y, float direction, float speed)
    {
        return parent.Add(x, y, direction, speed);
    }
    void Start()
    {
        Invoke("Tes", 1.5f);
        speed = -6f;

        Destroy(gameObject, 8f);
        rb = GetComponent<Rigidbody2D>();
        //  rb.velocity = transform.right * speed;
        //this.transform.eulerAngles = new Vector3(0, 0, 90);
        // this.transform.rotation = Quaternion.Euler(0, 0, 90);
        // SPd(speed);
        // rb.velocity = transform.right * speed;
        rb.velocity = transform.right * speed;

        // Velos(spd);
    }
    /*public void Velos(float spd){
        speed = spd;
    }*/
    private void FixedUpdate()
    {
        Angle = Direction - 90f;
        /*   if (transform.position.x < -15f)
           {
               Destroy(this.gameObject);
           }
           if (transform.position.y > 6f || transform.position.y < -6f)
           {
               Destroy(this.gameObject);
           }*/
    }
    private void Update()
    {
        //   rb.velocity = transform.right * -5;
        //    transform.localPosition += m_velocity;
    }
    public void SPd(float speed)
    {
        rb.velocity = transform.right * speed;

    }
    public void Plus(float spd)
    {
        speed = spd;
        // return spd;
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "hitJudge")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "YoumuSpell")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "Player")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "Block")
        {
            Destroy(gameObject);
        }
        if (collision.gameObject.tag == "Zangeki")
        {
            Destroy(gameObject);
        }

    }
    void Tes()
    {
    //    transform.localScale = new Vector3(2, -3, 1);
     //   rb.velocity = transform.right * 0;
        rb.velocity = transform.up * -6;
        //     Instantiate(st, transform.position, Quaternion.Euler(0f, 0f, 0));
    }

    IEnumerator _Medate1()
    {
        //2秒置きに弾を撃つ
        yield return new WaitForSeconds(0.1f);


    }
}



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

public class YsShot6 : Token
{
    //狙い撃ちするターゲット
    public static PlayerManager target = null;
    float ran;
    public Part part;
    public GameObject st;
    Rigidbody2D rb;
    GameManager gameManager;
    public static DragonShot instance;
    private Vector3 m_velocity; //速度
    public float speed = -6;
    public float spd;
    //敵弾管理
    public static TokenMgr<YsShot3> parent = null;
    public static YsShot3 Add(float x, float y, float direction, float speed)
    {
        return parent.Add(x, y, direction, speed);
    }

    public enum Part
    {
        Pattern1,
        Pattern2
    }
    void Start()
    {
        if (part==Part.Pattern1)
        {
            ran = Random.Range(0.1f, 1.5f);
            Invoke("Tes", ran);
            Invoke("Tes2", 2.5f);
        }
        if (part==Part.Pattern2)
        {
           Invoke("Tes3", 1);
            Invoke("Tes4", 2);
            Invoke("Tes5", 3);
        }
        speed = -6f;
        Destroy(gameObject, 20f);
        rb = GetComponent<Rigidbody2D>();
        rb.velocity = transform.right * speed;
     }
    private void FixedUpdate()
    {
        Angle = Direction - 90f;
    }
    public void SPd(float speed)
    {
        rb.velocity = transform.right * speed;

    }
    public void Plus(float spd)
    {
        speed = spd;
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "hitJudge")
        {
            Destroy(gameObject);
        }
        if (collision.gameObject.tag == "YoumuSpell")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "Player")
        {
            Destroy(gameObject);

        }
        if (collision.gameObject.tag == "Block")
        {
            Destroy(gameObject);
        }
        if (collision.gameObject.tag == "Zangeki")
        {
            Destroy(gameObject);
        }

    }
    public float GetAim()
    {
        float dx = target.X - X;
        float dy = target.Y - Y;
        return Mathf.Atan2(dy, dx) * Mathf.Rad2Deg;
    }
    void Tes()
    {
            rb.velocity = transform.right * 0;
    } 
    void Tes2()
    {
        float dir = GetAim();
        this.transform.rotation = Quaternion.Euler(0.0f, 0.0f, dir-180);
        rb.velocity = transform.right * -6;
    }
    void Tes3()
    {
        rb.velocity = transform.right * 6;
    }
    void Tes4()
    {
        rb.velocity = transform.right *0;
        rb.velocity = transform.up * 6;
    }
    void Tes5()
    {
        rb.velocity = transform.up * 0;
        float dir = GetAim();
        this.transform.rotation = Quaternion.Euler(0.0f, 0.0f, dir-180);
            rb.velocity = transform.right * -6;
    }

    IEnumerator _Medate1()
    {
        //2秒置きに弾を撃つ
        yield return new WaitForSeconds(0.1f);
    }
}


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

public class AudioPoint : MonoBehaviour
{
    [SerializeField] AudioClip BakuSE;
    private AudioSource audioSource;//AudioSourceを入れる
    void Start()
    {
        audioSource = GetComponent<AudioSource>();
    }
    void Update()
    {
    }
    public void YoumuDeath(){
        audioSource.PlayOneShot(BakuSE);

    }
}



using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//ボス
public class Boss : Token
{
    protected PlayerGaugeSlider playerGauge;
    public bool zaoriku;
    public float bob;
    public GameObject yous;
    //ボスを倒したフラグ
    public static bool bDestroyed = false;
     //コルーチンを開始したかどうか
    bool _bStart = false;

    //開始
    private void Start()
    {
        bDestroyed = false;
    }
    //消滅
    public override void Vanish()
    {
        //ボスを倒した
        bDestroyed = true;
        base.Vanish();
    }
    //更新
    private void Update()
    {
        if (_bStart == false)
        {
            //敵生成開始
            StartCoroutine("_GenerateEnemy");
            _bStart = true;
        }
    }


    public void Tame()
    {
        if (zaoriku)
        {
            zaoriku = false;
        }
    }
    public void Zaoraru(float a)
    {
        bob = a;
        zaoriku = true;
    }
    //敵生成
    IEnumerator _GenerateEnemy()
    {
        yield return new WaitForSeconds(3);//分割
        while (true)
        {
            YouseiB.Add(1, 7.2f, -5, 0, 1);
            YouseiB.parent = new TokenMgr<YouseiB>("YouseiB", 1);
            YouseiB.Add(2, 44, -10, 0, 1);
            YouseiB.parent = new TokenMgr<YouseiB>("YouseiB", 1);
            YouseiB.Add(2, 47f, -8, 0, 1);
            YouseiB.parent = new TokenMgr<YouseiB>("YouseiB", 1);
            YouseiB.Add(2, 51f, -7, 0, 1);
            YouseiB.parent = new TokenMgr<YouseiB>("YouseiB", 1);
            YouseiB.Add(2, 55f, -6, 0, 1);
            YouseiB.parent = new TokenMgr<YouseiB>("YouseiB", 1);
            YouseiB.Add(2, 59f, -5, 0, 1);
            YouseiB.parent = new TokenMgr<YouseiB>("YouseiB", 1);
            yield return new WaitForSeconds(6);//分割
        }
        yield return new WaitForSeconds(1000);//分割
    }

    //敵の生成
    YouseiB AddYouseiB(int id, float direction, float speed)
    {
        return YouseiB.Add(id, X, Y, direction, speed);
    }
}



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

public class Bullet : Token
{

    public float dehu=9f;
    //敵弾管理
    public static TokenMgr<Bullet> parent = null;
   //敵弾の取得
    public static Bullet Add(float x, float y, float direction, float speed)
    {
        return parent.Add(x, y, direction, speed);
    }
    void Start()
    {
        Destroy(gameObject, dehu);
    }
    public void Plus(float spd)
    {
        dehu = spd;
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Block")
        {
            Destroy(gameObject);
        }
        if (collision.gameObject.tag == "Player")
        {
            Destroy(gameObject);
        }  
        if (collision.gameObject.tag == "Zangeki")
        {
            Destroy(gameObject);
        }
    }
}


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

public class BulletManager : Token
{
    AudioSource audioSource;
    [SerializeField] AudioClip BakuhatsuSE;
    float speed = 10f;
    Rigidbody2D rb;
     int angeki = 1;
    
    void Start()
    {
        audioSource = GetComponent<AudioSource>();
        Destroy(gameObject,0.4f);
        rb = GetComponent<Rigidbody2D>();
        rb.velocity = transform.right * speed;
    }
    public override void Vanish()
    {
        base.Vanish();
    }
    
    private void OnTriggerEnter2D(Collider2D collision)
    {
        //敵に当たったら破壊、ダメージを与える
       
        if(collision.tag=="Enemy"){
        //ダメージを与える
             EnemyManager enemy  = collision.GetComponent<EnemyManager>();
             enemy.OnDamage(angeki);
             //自身を消す
             Vanish();
        }
        if (collision.tag == "Drago")
        {
            DragoWalk dragowalk = collision.GetComponent<DragoWalk>();
            dragowalk.OnDamage(angeki);
            //自身を消す
            Vanish();
        }  
        if (collision.tag == "Drago2")
        {
            DragoWalk1 dragowalk = collision.GetComponent<DragoWalk1>();
            dragowalk.OnDamage(angeki);
            //自身を消す
            Vanish();
        } 
        if (collision.tag == "YouseiB")
        {
            YouseiB youseiB = collision.GetComponent<YouseiB>();
            youseiB.OnDamage(angeki);
            //自身を消す
            Vanish();
        }



        if (collision.tag == "Dragon")
        {
            Dragon dragon = collision.GetComponent<Dragon>();
            dragon.OnDamage(angeki);
            //自身を消す
            Vanish();
        }  
        if (collision.tag == "Sakuya")
        {
            Sakuya sakuya1 = collision.GetComponent<Sakuya>();
            sakuya1.OnDamage(angeki);
            //自身を消す
            Vanish();
        }
        if (collision.gameObject.tag == "Block")
        {
            Destroy(gameObject);
        }

    }
}



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

public class buttonse : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        // 現在使用されているマテリアルを取得
        Material mat = this.GetComponent<Renderer>().material;
        // マテリアルの色設定に赤色を設定
        mat.color = new Color(1.0f, 1.0f, 1.0f, 0.5f);

    }
}



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

public class ButtonState : MonoBehaviour
{
    bool pressed = false;
    bool down = false;
    bool up = false;

    // ポインタダウン時に呼ばれる
    public void OnPointerDown()
    {
        if (this.pressed == false)
        {
            this.down = true;
        }
            this.pressed = true;
    }
    
    // ポインタアップ時に呼ばれる
    public void OnPointerUp()
    {
        if (this.pressed == true)
        {
            this.up = true;
        }
        this.pressed = false;
    }

    // ボタン押下の取得
    public bool IsPressed(){
       return this.pressed;
      }
    
    // ボタンダウンの取得
    public bool IsDown()
    {
        bool result = this.down;
        this.down = false;
        return result;
    }

    // ボタンアップの取得
    public bool IsUp()
    {
        bool result = this.up;
        this.up = false;
        return result;
    }
}



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

public class Dragon : Token
{
    public GameObject Illust;
    public float maxLife;
    Animator animator;
    public GameObject bulletPrefab;
    public int hp = 300;
    public Transform bulletPoint;
    DragonShot drasho;
    Rigidbody2D rb;
    public Transform titenA;
    public Transform titenB;
    public Transform titenC;
    public Transform titenD;
    public Transform PlayPo;
    bool test = false;
    bool testB = false;
    bool testC = false;
    bool testD = false;
    bool testE = false;
    bool testF = false;
    bool testG = false;
    public GameManager gamemanager;

    [SerializeField] AudioClip DeathSE;
    [SerializeField] AudioClip LaserSE;
    [SerializeField] AudioClip DamageSE;
    [SerializeField] AudioClip RemiriaSE;
    [SerializeField] AudioClip Remiria2SE;
    [SerializeField] AudioClip TeleSE;
    [SerializeField] AudioClip RemiSE;
    protected HPGAGE3 playerGauge3;

    //敵管理
    public static TokenMgr<EnemyManager> parent = null;
    public static TokenMgr<DragonShot2> parant = null;

    public float tis = 1.0f;
    //二点間の距離を入れる
    private float distance_two;
    private float distance_three;

    public GameObject Samusu1;


    //狙い撃ちするターゲット
    public static PlayerManager target = null;
    //狙い撃ち角度を取得する
    public float GetAim(){
        float dx = target.X - X;
        float dy = target.Y - Y;
        return Mathf.Atan2(dy, dx) * Mathf.Rad2Deg;
    }
    void DoBullet(float direction, float speed)
    {
        Bullet.Add(X, Y, direction, speed);
    }

        //敵のID
        int _id = 1;
    private void FixedUpdate()
    {
      TitenA();
    }
    private void Start()
    {
        hp = 300;
        playerGauge3 = GameObject.FindObjectOfType<HPGAGE3>();
        playerGauge3.SetPlayer(this);
        maxLife = 300;
        // 現在使用されているマテリアルを取得
        Material mat = this.GetComponent<Renderer>().material;
        // マテリアルの色設定に赤色を設定
        mat.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);


        //Color color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
        animator = GetComponent<Animator>();
        //二点間の距離を代入(スピード調整に使う)
        distance_two = Vector3.Distance(titenA.position, titenB.position);
        distance_three = Vector3.Distance(titenA.position, titenC.position);
        //コルーチン開始
        StartCoroutine("_Update1");
        //  StartCoroutine("_Medate1");
        rb = GetComponent<Rigidbody2D>();
        TitenA();
    }
    IEnumerator _GenerateEnemy()
    {
        int tim = 0;
        float dir = 0f;
        while (true)
        {
            yield return new WaitForSeconds(1.0f);
            if (tim <= 5)
            {
                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 0f));

                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 45f));
                 audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 90f)); Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 135f));

                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 180f)); Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 225f));

                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 280f));
               audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 325f));
              audioS.PlayOneShot(Remiria2SE);
            } else if (tim <= 10)
            {
                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 22f));

                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 70f));
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 115f)); Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 160f));
                 audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 180f));
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 250f)); Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 300f));
                 audioS.PlayOneShot(Remiria2SE);
            }
            else if(tim<=20){
                tim++;
                dir += 8f;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 0f-dir));
                
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 45f-dir));
                  audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 90f-dir)); Instantiate(bulletPrefab, 
                    bulletPoint.position, Quaternion.Euler(0f, 0f, 135f-dir));

                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 180f-dir)); Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 225f-dir));
                 audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 280f-dir));
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 325f-dir));
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 22f-dir));
                    audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 70f-dir));
                    audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 115f-dir)); Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 160f-dir));
                     audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 180f-dir));
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 250f)); Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 300f-dir));
                audioS.PlayOneShot(Remiria2SE);
            }
           else if(tim<=25)
            {
                animator.SetTrigger("Teleport");
                yield return new WaitForSeconds(0.5f);
                testB = true;
                yield return StartCoroutine("_Update4");
            }
        }
    }
        IEnumerator _Medate1()
        {
            float ypos = 0f;
            float xpos = 0f;
            while (true)
            {
                yield return new WaitForSeconds(0.01f);
                ypos -= 0.1f;
                xpos -= 0.1f;
                this.transform.position += new Vector3(xpos, ypos, 0);
                if (ypos <= -1.8f && xpos <= -7.29f)
                {
                    break;
                }
            }
        }
    bool teleA = true;
    bool teleB = true;
    bool teleC = true;
    bool teleD = true;
    bool teleE = true;
    bool teleF = true;
    bool teleG = true;

    void TitenA()
    {
        var audioS = FindObjectOfType<AudioSource>();

        if (hp <= 85*3)
        {
            // 現在の位置
            float present_Location = (Time.time * tis) / distance_two;
            // オブジェクトの移動
            transform.position = Vector3.Lerp(titenA.position, titenB.position, present_Location);
            if (test){
                if (teleA)
                {
                    audioS.PlayOneShot(TeleSE);
                    teleA = false;
                }
                // 現在の位置
                float present_Loc = (Time.time * 0.4f) / distance_two;
                // オブジェクトの移動
                transform.position = Vector3.Lerp(titenA.position, titenC.position, present_Loc);
                transform.localScale = new Vector3(-1, 1, 1);
               
                if (testF)
                {
                    if (teleF)
                    {
                        audioS.PlayOneShot(TeleSE);
                        teleF = false;
                    }
                    // オブジェクトの移動
                    transform.position = Vector3.Lerp(titenA.position, titenB.position, present_Loc);
                }
                if (testC)
                {
                    if (teleC)
                    {
                        audioS.PlayOneShot(TeleSE);
                        teleC = false;
                    }
                    transform.position = Vector3.Lerp(titenA.position, titenC.position, present_Loc);
                    transform.localScale = new Vector3(-1, 1, 1);
                }
                if (testB)
                {
                    if (teleB)
                    {
                        audioS.PlayOneShot(TeleSE);
                        teleB = false;
                    }
                    transform.position = Vector3.Lerp(titenA.position, titenD.position, present_Loc);
                    transform.localScale = new Vector3(1, 1, 1);
                }
                if (testG)
                    {
                    if (teleG)
                    {
                        audioS.PlayOneShot(TeleSE);
                        teleG = false;
                    }
                    transform.position = Vector3.Lerp(titenA.position,titenB.position, present_Loc);

                }
                if (testD)
                {
                    if (teleD)
                    {
                        animator.SetTrigger("Teleport");
                        audioS.PlayOneShot(TeleSE);

                        teleD = false;
                    }
                      
                        transform.position = Vector3.Lerp(titenA.position, titenD.position, present_Loc);
                    transform.localScale = new Vector3(1, 1, 1);
                    
                }
                if (testE)
                    {
                    transform.position = Vector3.Lerp(titenA.position, titenC.position, present_Loc);
                    transform.localScale = new Vector3(-1, 1, 1);
                    if (teleE)
                    {
                        animator.SetTrigger("Teleport");
                        audioS.PlayOneShot(TeleSE);
                        teleE = false;
                    }
                }
            }
        }
    }
    void TitenC(){
        // 現在の位置
        float present_Loc = (Time.time * 0.4f) / distance_two;
        // オブジェクトの移動
        transform.position = Vector3.Lerp(titenA.position, titenC.position, present_Loc);

    }
    void TitenD()
    {
        // 現在の位置
        float present_Loc = (Time.time * 0.4f) / distance_two;
        // オブジェクトの移動
        transform.position = Vector3.Lerp(titenA.position, titenD.position, present_Loc);
    }
    IEnumerator _Update1(){

        while (true){
            
            //2秒置きに弾を撃つ
            yield return new WaitForSeconds(2.0f);
            //狙い撃ち角度を取得
            float dir = GetAim();
            Bullet.Add(X, Y, dir-5f, 2);
            Bullet.Add(X, Y, dir+5f, 2);
   
            var audioS = FindObjectOfType<AudioSource>();
            audioS.PlayOneShot(RemiriaSE);

            if (hp<=85*3){
                _id = 2;
                 yield return StartCoroutine("_Update2");
                break;
            }
        }
    }
    IEnumerator _Update2()
    {
        //発射角度を回転しながら撃つ
       float dir = 0f;
        float negadir = 0f;
        int tim = 0;
        while (true){
            yield return new WaitForSeconds(0.1f);
            if (tim <= 50)
            {
                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 1f * dir));
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);

                dir += 16f;
            }
            else if (tim <= 100)
            {
                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 1f * negadir));
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
                negadir -= 16f;
            }
            else if (tim <= 150)
            {
                tim++;
                dir += 16f;
                negadir -= 16f;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 1f * dir));
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, 1f * negadir));
                audioS.PlayOneShot(Remiria2SE);
            }
            else
            {
                animator.SetTrigger("Teleport");
                yield return new WaitForSeconds(0.5f);
                yield return StartCoroutine("_Update3");
            }
        }
    }
    IEnumerator _Update3()
    {

        test = true;
        while (true){
            //  2秒置きに弾を撃つ
            yield return new WaitForSeconds(2.0f);
            DoBullet(0 - 2, 4);
            DoBullet(0 , 4);
            DoBullet(0 +2, 4);
            var audioS = FindObjectOfType<AudioSource>();
            audioS.PlayOneShot(RemiriaSE);
            //狙い撃ち角度を取得
            float dir = GetAim();
            Bullet.Add(X, Y, dir + 5f, 2);
            audioS.PlayOneShot(RemiriaSE);
            if (hp <= 70*3)
            {
                animator.SetTrigger("Teleport");
                yield return new WaitForSeconds(0.5f);
                testF = true;
                yield return StartCoroutine("_GenerateEnemy");
            }
        }
    }
    IEnumerator _Update4()
    {
        while (true)
        {
            yield return new WaitForSeconds(2.0f);
            DoBullet(180f - 2f, 4);
            DoBullet(180f, 4);
            DoBullet(180f + 2f, 4);
            var audioS = FindObjectOfType<AudioSource>();
            audioS.PlayOneShot(RemiriaSE);
            float dir = GetAim();
            Bullet.Add(X, Y, dir - 5f, 2);
            Bullet.Add(X, Y, dir + 5f, 2);
            audioS.PlayOneShot(RemiriaSE);
            if (hp<=55*3){
                animator.SetTrigger("Teleport");
                yield return new WaitForSeconds(0.5f);
                testG = true;
                yield return StartCoroutine("_Update5");
            }
        }
    }
    IEnumerator _Update5()
    {
        while (true)
        {
            int tim = 0;
            float dir =0;
            while (true)
            {
                yield return new WaitForSeconds(0.1f);
                if (tim <= 100)
                {
                    dir -= 17f;
                    tim++;
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir));
                    var audioS = FindObjectOfType<AudioSource>();
                    audioS.PlayOneShot(Remiria2SE);
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir - 90f));
                      audioS.PlayOneShot(Remiria2SE);
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir - 180f));
                    audioS.PlayOneShot(Remiria2SE);
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir - 270f));
                    audioS.PlayOneShot(Remiria2SE);
                }
                else if (tim <= 200)
                {
                    dir += 17f;
                    tim++;
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir));
                    var audioS = FindObjectOfType<AudioSource>();
                    audioS.PlayOneShot(Remiria2SE);
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir - 90f));
                    audioS.PlayOneShot(Remiria2SE);
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir - 180f));
                    audioS.PlayOneShot(Remiria2SE);
                    Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir - 270f));
                        audioS.PlayOneShot(Remiria2SE);
                }
                else if(tim<=300){
                    animator.SetTrigger("Teleport");
                    yield return new WaitForSeconds(0.5f);
                   testG = false;
                    testB = false;
                    testF = false;
                   yield return StartCoroutine("_Update6");
                }
            }
            }
    }
    IEnumerator _Update6()
   { 
   while (true)
        {
            yield return new WaitForSeconds(2.0f);
            DoBullet(0f - 2f, 4);
            DoBullet(0f, 4);
            DoBullet(0f + 2f, 4);

            var audioS = FindObjectOfType<AudioSource>();
            audioS.PlayOneShot(RemiriaSE);
            float dir = GetAim();
            Bullet.Add(X, Y, dir - 5f, 2);
            Bullet.Add(X, Y, dir, 2);
            Bullet.Add(X, Y, dir + 5f, 2);
           audioS.PlayOneShot(RemiriaSE);
            if (hp<=40*3){
                testF = true;
                yield return StartCoroutine("_Update7");
            }
        }
    }

    IEnumerator _Update7()
    {
        int tim = 0;
        float dir = 0f;
        float negabir = 180f;
        while (true){

            yield return new WaitForSeconds(0.1f);
            if (tim <= 14)
            {
                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir));
                dir -= 10f;
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
            }
            else if (tim <= 28)
            {
                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir));
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
                dir += 10f;
            }
            else if(tim<=64){

                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir));
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(Remiria2SE);
                dir += 10f;
            }
            else if (tim <= 80)
            {
                yield return StartCoroutine("_Update8");
            }
        }
    }
    void beam(){
        float rad = GetAim();
        Bullet.Add(transform.position.x, transform.position.y, rad, 2);
    }
    public GameObject dragonshot2;
    IEnumerator _Update8()
    {
        int tim = 0;
        const float ROT = 5.0f;
        float baseDirection = GetAim();
        int count = 0;
        float dir = 0f;
        while (true)
        {
            yield return new WaitForSeconds(0.1f);

            if (tim <= 100)
            {
                float rad = GetAim();
                float ran = Random.Range(180f, 360f);
                Bullet.Add(transform.position.x, transform.position.y, ran, 2f);
                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(RemiriaSE);
                tim++;
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir));
                audioS.PlayOneShot(Remiria2SE);
                dir -= 10f;
            }
            else if (tim <= 200)
            {
                float rad = GetAim();
                float ran = Random.Range(180f, 360f);
                Bullet.Add(transform.position.x, transform.position.y, ran, 2);
                tim++;

                var audioS = FindObjectOfType<AudioSource>();
                audioS.PlayOneShot(RemiriaSE);
                Instantiate(bulletPrefab, bulletPoint.position, Quaternion.Euler(0f, 0f, dir));
                 audioS.PlayOneShot(Remiria2SE);
                dir += 10f;
            }
            else
            {

                yield return new WaitForSeconds(5f);
                yield return StartCoroutine("_Update9");
            }
        }
    }

        IEnumerator _Update9()
        {

        Vector3 ill5 = new Vector3(0f, 8f, 0f);
        var audioS = FindObjectOfType<AudioSource>();
        for (int i = 0; i < 5; i++)
        {
            audioS.PlayOneShot(RemiSE);
        }
        Instantiate(Illust, PlayPo.position + ill5, Quaternion.Euler(0f, 0f, 0));
        yield return new WaitForSeconds(1f);
        while (true)
        {
            yield return new WaitForSeconds(2f);

            for (int index = 0; index < 5; index++)
            {
                testE = false;
                testD = true;
                float rad = GetAim();
                Bullet.Add(X, Y-0.6f, 180, 2);
                audioS.PlayOneShot(RemiriaSE);
                yield return new WaitForSeconds(0.1f);
                rad = GetAim();
                Bullet.Add(X, Y-0.6f, 180, 2);
                audioS.PlayOneShot(RemiriaSE);
            }

            for (int index = 0; index < 5; index++)
            {
                testD = false;
                testE = true;
                float rad = GetAim();
                Bullet.Add(X, Y-0.3f, 0, 2);
                audioS.PlayOneShot(RemiriaSE);
                yield return new WaitForSeconds(0.1f);
                rad = GetAim();
                Bullet.Add(X, Y-0.3f, 0, 2);
                audioS.PlayOneShot(RemiriaSE);
            }
            if (hp <= 10*3)
            {
                Debug.Log("game");
            }
        }
    }
    IEnumerator ColorChance(){
        Material dragond = this.GetComponent<Renderer>().material;
        dragond.color = new Color(1.0f, 1.0f, 1.0f, 0.5f);

        yield return new WaitForSeconds(0.1f);
        dragond.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
    }
    public void OnDamage(int damage)
    {
        playerGauge3.GaugeReduction(damage);
        StartCoroutine("ColorChance");
        hp -= damage;
        var audioS = FindObjectOfType<AudioSource>();
        audioS.PlayOneShot(DamageSE);

        //animator.SetTrigger("IsHurt");
        if (hp <= 0)
        {
            Die();
        }
    }
    void Die()
    {
        var audioS = FindObjectOfType<AudioSource>();
        audioS.PlayOneShot(DeathSE);
        for (int i = 0; i < 32; i++)
        {
            Particle.Add(X, Y);

        }
        gamemanager.GameClear();
        DestroyObj();
    }
}



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

public class DragonShot : Token
{
        float speed = 3f;
        Rigidbody2D rb;
    void Start()
    {
        Destroy(gameObject, 8f);
        rb = GetComponent<Rigidbody2D>();
        rb.velocity = transform.right * speed;
    }
     public void Drasho(){
        this.Vanish();
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Block")
        {
            Destroy(gameObject);
        }
            if (collision.gameObject.tag == "Player")
            {
                Destroy(gameObject);
            }
        if (collision.gameObject.tag == "Zangeki")
        {
            Destroy(gameObject);
        }
    }
    IEnumerator _Medate1()
    {
        //2秒置きに弾を撃つ
        yield return new WaitForSeconds(0.1f);
    }
}