Example #1
0
    public void Spawn(Vector3 position, Vector3 velocity)
    {
        ShmupPlane e = Enemies.FirstOrDefault(en => !en.gameObject.activeSelf);

        if (e)
        {
            e.Init(position, velocity);
        }
    }
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);
        }
    }