📜  如何统一实例化更多敌人 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:21.749000             🧑  作者: Mango

代码示例1
void Update()
    {
        if (name1 == 0)
        {
            name2 ++;
            int i = name2;

            while (i > 0)
            {
                x = Random.Range(-8.03f, 8.07f);
                y = Random.Range(4.21f, 1.66f);

                Instantiate(name1, new Vector2(x, y), name1.transform.rotation);

                i--;

            }
            enemynumbers = lvl;


        }
        

    }