示例#1
0
    private IEnumerator killcore_()
    {
        enemycore.SetActive(false);
        text.text = "Stage clear!";
        GameObject     _9S       = GameObject.Find("9S");
        _9S_controller _9Sscript = _9S.GetComponent <_9S_controller>();

        _9Sscript.enabled = false;

        //cleaning bullets
        GameObject[] playerBullets = GameObject.FindGameObjectsWithTag("bullets");
        CleanGameObjects(playerBullets);
        GameObject[] redBullets = GameObject.FindGameObjectsWithTag("red_bullets");
        CleanGameObjects(redBullets);
        GameObject[] darkBullets = GameObject.FindGameObjectsWithTag("dark_bullets");
        CleanGameObjects(darkBullets);



        Time.timeScale = 0;
        yield return(new WaitForSecondsRealtime(2f));

        lvl++;
        text.text = "Next level: " + lvl.ToString();
        yield return(new WaitForSecondsRealtime(2f));

        start_spawning();
        Time.timeScale    = 1;
        _9Sscript.enabled = true;
        text.text         = "";
    }
示例#2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("walls"))
     {
         GameObject.Destroy(gameObject);
     }
     if (other.gameObject.CompareTag("Player"))
     {
         _9S_controller player = other.gameObject.GetComponent <_9S_controller>();
         player.takedmg();
         Destroy(gameObject);
     }
 }
    private IEnumerator killcore_()
    {
        enemycore.SetActive(false);
        text.text = "Stage clear!";
        GameObject     _9S       = GameObject.Find("9S");
        _9S_controller _9Sscript = _9S.GetComponent <_9S_controller>();

        _9Sscript.enabled = false;
        Time.timeScale    = 0;
        yield return(new WaitForSecondsRealtime(2f));

        lvl++;
        text.text = "Next level: " + lvl.ToString();
        yield return(new WaitForSecondsRealtime(2f));

        start_spawning();
        Time.timeScale    = 1;
        _9Sscript.enabled = true;
        text.text         = "";
    }