コード例 #1
0
ファイル: phases2.cs プロジェクト: Torhu/Pj-Touhou-game
    void Update()
    {
        if (EplayerHealth.currentHealth == 400)
        {
            EShots.SetActive(true);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-5.4f, 0, 2.68f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0.92f, 0, 4.81f), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0.92f, 0, 4.81f), new Quaternion(0, 0, 0, 0));
            sp4.GetComponent <Transform>().SetPositionAndRotation(new Vector3(4.64f, 0, 2.68f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed    = 6f;
            EShots.GetComponent <EnemyShots>().fireRate = 0.15f;
        }


        else if (EplayerHealth.currentHealth == 300)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-4.87f, 0, 2.29f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-0.04f, 0, 6.37f), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-0.04f, 0, 6.37f), new Quaternion(0, 0, 0, 0));
            sp4.GetComponent <Transform>().SetPositionAndRotation(new Vector3(4.95f, 0, 3.35f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed    = 6;
            EShots.GetComponent <EnemyShots>().fireRate = 0.15f;
        }

        else if (EplayerHealth.currentHealth == 200)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-4.22f, 0, 8.22f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-0.04f, 0, 6.37f), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-0.04f, 0, 6.37f), new Quaternion(0, 0, 0, 0));
            sp4.GetComponent <Transform>().SetPositionAndRotation(new Vector3(4.47f, 0, 4.66f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed    = 5;
            EShots.GetComponent <EnemyShots>().fireRate = 0.2f;
        }
        else if (EplayerHealth.currentHealth == 100)
        {
            EShots.SetActive(false);
            EShots2.SetActive(true);
            EShots2.GetComponent <EnemyShots>().fireRate = 3f;
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-4.87f, 0, 4.42f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-0.04f, 0, 6.37f), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-0.04f, 0, 6.37f), new Quaternion(0, 0, 0, 0));
            sp4.GetComponent <Transform>().SetPositionAndRotation(new Vector3(4.47f, 0, 4.66f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed = 5;
        }
    }
コード例 #2
0
    void Update()
    {
        if (EplayerHealth.currentHealth == 400)
        {
            EShots.SetActive(true);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-4.9f, 0, 3.88f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(1.4f, 0, 5.33f), new Quaternion(0, 0, 0, 0));

            Emt.GetComponent <EnemyMoveTest>().Speed    = 3;
            EShots.GetComponent <EnemyShots>().fireRate = 0.2f;
        }
        else if (EplayerHealth.currentHealth == 300)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-6.91f, 0, 5.72f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-6.9f, 0, -7.82f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed = 15;
            //EShots.GetComponent<Transform>().SetPositionAndRotation(new Vector3(0, 0, 0), new Quaternion(180, 180, 180, 180));
            EShots.GetComponent <Transform>().transform.eulerAngles = new Vector3(0, 90, 0);



            EShots.GetComponent <EnemyShots>().fireRate = 0.2f;
        }
        else if (EplayerHealth.currentHealth == 210)
        {
            EShots.SetActive(false);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-6.9f, 0, -9.93f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-6.9f, 0, -9.93f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed = 30;

            EShots.GetComponent <Transform>().transform.eulerAngles = new Vector3(0, 90, 0);
        }
        else if (EplayerHealth.currentHealth == 200)
        {
            EShots.SetActive(true);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-7.05f, 0, -1.97f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-5.9f, 0, -9.93f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed    = 2;
            EShots.GetComponent <EnemyShots>().fireRate = 0.01f;
        }

        else if (EplayerHealth.currentHealth == 110)
        {
            EShots.SetActive(false);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-11.31f, 0, 14.09f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-11.31f, 0, 14.09f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed = 30;

            EShots.GetComponent <Transform>().Rotate(new Vector3(0, 360, 0) * Time.deltaTime);
        }
        else if (EplayerHealth.currentHealth <= 100)
        {
            EShots.SetActive(true);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-11.31f, 0, 14.09f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-11.31f, 0, 14.09f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed    = 1;
            EShots.GetComponent <EnemyShots>().fireRate = 0.009f;
            EShots.GetComponent <Transform>().Rotate(new Vector3(0, 360, 0) * Time.deltaTime);
        }
    }
コード例 #3
0
    void Awake()
    {
        PlayerObject  = GameObject.FindGameObjectWithTag("Enemy");
        EplayerHealth = PlayerObject.GetComponent <EnemyHealth>();

        Emt    = gameObject.GetComponent <EnemyMoveTest>();
        EShots = GameObject.FindGameObjectWithTag("EnemyBulletSpawnph1");
        sp1    = GameObject.FindGameObjectWithTag("sph11");
        sp2    = GameObject.FindGameObjectWithTag("sph12");

        Emt.GetComponent <EnemyMoveTest>().Speed = 1;
        EShots.SetActive(false);
    }
コード例 #4
0
    void Update()
    {
        if (EplayerHealth.currentHealth == 400)
        {
            EShots2.SetActive(true);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(5.27f, 0, 3.88f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-0.81f, 0, 5.33f), new Quaternion(0, 0, 0, 0));

            Emt.GetComponent <EnemyMoveTest>().Speed     = 3;
            EShots2.GetComponent <EnemyShots>().fireRate = 0.2f;
        }

        else if (EplayerHealth.currentHealth == 300)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(7.08f, 0, 5.72f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(7f, 0, -7.82f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed                 = 20;
            EShots2.GetComponent <EnemyShots>().fireRate             = 0.2f;
            EShots2.GetComponent <Transform>().transform.eulerAngles = new Vector3(0, -90, 0);
        }
        else if (EplayerHealth.currentHealth == 210)
        {
            EShots2.SetActive(false);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(4.77F, 0, 5.72f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(4.77f, 0, 5.72f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed = 10;
        }

        else if (EplayerHealth.currentHealth <= 200)
        {
            EShots2.SetActive(true);
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(12.61F, 0, 12f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(12.61f, 0, 12f), new Quaternion(0, 0, 0, 0));
            Emt.GetComponent <EnemyMoveTest>().Speed     = 1;
            EShots2.GetComponent <EnemyShots>().fireRate = 0.009f;
            EShots2.GetComponent <Transform>().Rotate(new Vector3(0, 360, 0) * Time.deltaTime);
        }
    }
コード例 #5
0
ファイル: phases2.cs プロジェクト: Torhu/Pj-Touhou-game
 void Awake()
 {
     EplayerHealth = gameObject.GetComponent <EnemyHealth>();
     Emt           = gameObject.GetComponent <EnemyMoveTest>();
     EShots        = GameObject.FindGameObjectWithTag("EnemyBulletSpawn");
     EShots2       = GameObject.FindGameObjectWithTag("pls");
     sp1           = GameObject.FindGameObjectWithTag("sp1");
     sp2           = GameObject.FindGameObjectWithTag("sp2");
     sp3           = GameObject.FindGameObjectWithTag("sp3");
     sp4           = GameObject.FindGameObjectWithTag("sp4");
     Emt.GetComponent <EnemyMoveTest>().Speed = 1;
     EShots.SetActive(false);
     EShots2.SetActive(false);
 }
コード例 #6
0
    void Update()
    {
        if (EplayerHealth.currentHealth == 300)
        {
            Emt.GetComponent <EnemyMoveTest>().Speed    = 8;
            EShots.GetComponent <EnemyShots>().fireRate = 0.1f;
        }
        else if (EplayerHealth.currentHealth == 200)
        {
            Emt.GetComponent <EnemyMoveTest>().Speed    = 9;
            EShots.GetComponent <EnemyShots>().fireRate = 0.09f;
        }

        else if (EplayerHealth.currentHealth == 160)
        {
            Emt.GetComponent <EnemyMoveTest>().Speed    = 10;
            EShots.GetComponent <EnemyShots>().fireRate = 0.08f;
        }

        else if (EplayerHealth.currentHealth == 140)
        {
            Emt.GetComponent <EnemyMoveTest>().Speed    = 1;
            EShots.GetComponent <EnemyShots>().fireRate = 0.08f;
        }

        if (EplayerHealth.currentHealth == 135 && EplayerHealth.currentHealth > 100)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(1.44f, 0, 10.97f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-1, 0, 7.11f), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-3.37f, 0, 10.01f), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 1;
            Emt.GetComponent <EnemyMoveTest>().Speed    = 10;
        }


        if (EplayerHealth.currentHealth <= 130 && EplayerHealth.currentHealth > 100)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(1.44f, 0, 10.97f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-1, 0, 7.11f), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-3.37f, 0, 10.01f), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 0.0009f;
            Emt.GetComponent <EnemyMoveTest>().Speed    = 10;
        }


        if (EplayerHealth.currentHealth <= 120 && EplayerHealth.currentHealth > 100)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(2.56f, 0, 9.16f), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-1, 0, 7.65f), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(-4.40f, 0, 9.12f), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 0.0009f;
            Emt.GetComponent <EnemyMoveTest>().Speed    = 6;
        }

        if (EplayerHealth.currentHealth <= 115 && EplayerHealth.currentHealth > 100)
        {
            //sp1.GetComponent<Transform>().SetPositionAndRotation(new Vector3(1.44f, 0, 10.97f), new Quaternion(0, 0, 0, 0));
            //sp2.GetComponent<Transform>().SetPositionAndRotation(new Vector3(-1, 0, 7.11f), new Quaternion(0, 0, 0, 0));
            //sp3.GetComponent<Transform>().SetPositionAndRotation(new Vector3(-3.37f, 0, 10.01f), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 0.0009f;
            Emt.GetComponent <EnemyMoveTest>().Speed    = 2;
        }

        if (EplayerHealth.currentHealth <= 95 && EplayerHealth.currentHealth > 90)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 1;
            EShots.GetComponent <Transform>().Rotate(new Vector3(0, 50, 0) * Time.deltaTime);
        }

        if (EplayerHealth.currentHealth <= 90 && EplayerHealth.currentHealth > 80)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 0.0000001f;
            EShots.GetComponent <Transform>().Rotate(new Vector3(0, 100, 0) * Time.deltaTime);
        }

        if (EplayerHealth.currentHealth <= 80 && EplayerHealth.currentHealth > 70)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 0.0000001f;
            EShots.GetComponent <Transform>().Rotate(new Vector3(0, 125, 0) * Time.deltaTime);
        }

        if (EplayerHealth.currentHealth <= 70 && EplayerHealth.currentHealth > 50)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 0.0000001f;
            EShots.GetComponent <Transform>().Rotate(new Vector3(0, 150, 0) * Time.deltaTime);
        }

        if (EplayerHealth.currentHealth <= 50)
        {
            sp1.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp2.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            sp3.GetComponent <Transform>().SetPositionAndRotation(new Vector3(0, 0, 3), new Quaternion(0, 0, 0, 0));
            EShots.GetComponent <EnemyShots>().fireRate = 0.0000001f;
            EShots.GetComponent <Transform>().Rotate(new Vector3(0, 200, 0) * Time.deltaTime);
        }
    }