// Use this for initialization
    void Start()
    {
        if (Instance == null)
            Instance = this;
        else
            Destroy(gameObject);

        for (int i = 0; i < MAX_ENEMIES; i++)
        {
            ShmupPlane e = ((GameObject)Instantiate(PlanePrefab)).GetComponent<ShmupPlane>();
            e.transform.parent = transform;
            e.gameObject.SetActive(false);
            Enemies.Add(e);
        }
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        for (int i = 0; i < MAX_ENEMIES; i++)
        {
            ShmupPlane e = ((GameObject)Instantiate(PlanePrefab)).GetComponent <ShmupPlane>();
            e.transform.parent = transform;
            e.gameObject.SetActive(false);
            Enemies.Add(e);
        }
    }