Help to trigger a sequence of instances

Can someone please advise;
On colliding with a trigger my Player is spawning objects
After the player has spawned 10 objects from one instance I’m trying to have it move on and draw objects from the second instance .

I’ve been trying to figure it out but I can’t for the life of me work it out.
I’m very new at programming so I thought I’d ask around.
Any help would be appreciated

A quick and dirty solution would be to add a counter.

    int counter;

    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            // Count from 1 to 20 repeatedly
            counter = counter < 20 ? counter + 1 : counter = 1;
            if (counter < 11)
            {
                // Do this 10 times
            }
            else
            {
                // Then do this 10 times
            }
        }
    }

ps Remember to post code using code tags instead of a picture.

Thanks for the advice, I think I’ve typed it correctly. Though when the object passes through a trigger the counter value increases by 1 and that’s it.
If I set the trigger to 12 it’ll count to 13 and sits at 13 but goes back to spawning the first instance.

I’ll have to spend some more time with it.
Thank you for having a look at it for me. I’ve got a lot to learn.

using UnityEngine;
using System.Collections;

public class FingerScript : MonoBehaviour {
	// Use this for initialization
	void Start () {


	}

	// Update is called once per frame
	void Update () {

	}
	public int counter;

	void OnTriggerEnter2D(Collider2D collision)
	{
		if (collision.CompareTag("Player")) {

			counter = counter < 20 ? counter + 1 : counter = 1;
			if (counter < 11) {	
				FingerManager.Instance.SpawnFinger ();
			} else {
				FingerManager.Instance.SpawnFinger1 ();
			}
		}
	}
}