Beispiel #1
0
    /// <summary>
    /// 生成敌人生成器
    /// </summary>
    public void CreateEnemyGenerator()
    {
        GameObject go = GameObject.Find("EnemyGenerator");

        if (go == null)
        {
            go = new GameObject("EnemyGenerator");
        }
        EnemyGenerator eg = go.GetComponent <EnemyGenerator>();

        if (eg == null)
        {
            eg = go.AddComponent <EnemyGenerator>();
        }
        eg.Init();
    }